The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
This report summarizes scanner evidence for pytest-dev/pytest, a Python project with 14,587 GitHub stars. SynthScan examined 119,074 lines of code across 286 source files, recording 3047 pattern matches distributed across 18 syntactic categories. The legacy adjusted pattern signal is 21.4 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 2525 finding(s).
Are imports declared and package/API names verified? 358 finding(s).
Are wrappers, guards, and repeated structures necessary? 2521 finding(s).
Which changes need focused human review? 3047 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 3047 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | testing/test_legacypath.py | 30 | def test_testdir_makefile_dot_prefixes_extension_silently( | CODE |
| LOW⚡ | testing/test_legacypath.py | 38 | def test_testdir_makefile_ext_none_raises_type_error(testdir: Testdir) -> None: | CODE |
| LOW⚡ | testing/test_legacypath.py | 44 | def test_testdir_makefile_ext_empty_string_makes_file(testdir: Testdir) -> None: | CODE |
| LOW | testing/test_legacypath.py | 68 | def test_tmpdir_equals_tmp_path(tmpdir: LEGACY_PATH, tmp_path: Path) -> None: | CODE |
| LOW | testing/test_legacypath.py | 72 | def test_tmpdir_always_is_realpath(pytester: pytest.Pytester) -> None: | CODE |
| LOW | testing/test_legacypath.py | 94 | def test_fixturerequest_getmodulepath(pytester: pytest.Pytester) -> None: | CODE |
| LOW | testing/test_legacypath.py | 109 | def test_session_scoped_unavailable_attributes(self, session_request): | CODE |
| LOW | testing/test_legacypath.py | 173 | def test_inifile_from_cmdline_main_hook(pytester: pytest.Pytester) -> None: | STRING |
| LOW | testing/test_setuponly.py | 16 | def test_show_only_active_fixtures( | CODE |
| LOW | testing/test_setuponly.py | 42 | def test_show_different_scopes(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 71 | def test_show_nested_fixtures(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 105 | def test_show_fixtures_with_autouse(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 132 | def test_show_fixtures_with_parameters(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 165 | def test_show_fixtures_with_parameter_ids(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 194 | def test_show_fixtures_with_parameter_ids_function(pytester: Pytester, mode) -> None: | CODE |
| LOW | testing/test_setuponly.py | 214 | def test_dynamic_fixture_request(pytester: Pytester) -> None: | CODE |
| LOW | testing/test_setuponly.py | 219 | def dynamically_requested_fixture(): | STRING |
| LOW | testing/test_setuponly.py | 262 | def test_show_fixtures_and_execute_test(pytester: Pytester) -> None: | CODE |
| LOW | testing/test_setuponly.py | 307 | def test_show_fixture_action_with_bytes(pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1717 | def test_walrus_operator_change_value(): | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1721 | def test_walrus_operator_not_override_value(): | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1763 | def test_call_other_function_arg(): | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1778 | def test_call_other_function_k_arg(): | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1793 | def test_function_of_function(): | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1841 | def test_walrus_no_double_eval_basic(self, pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1861 | def test_walrus_no_double_eval_running_counter(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 78 | def test_place_initial_imports(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 143 | def test_positions_are_preserved(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 360 | def test_rewrites_plugin_as_a_package(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 429 | def test_assertrepr_compare_same_width(self, request) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 449 | def test_dont_rewrite_if_hasattr_fails(self, request) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 475 | def test_assert_already_has_message(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 494 | def test_assertion_message_multiline(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 507 | def test_assertion_message_tuple(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 518 | def test_assertion_message_expr(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 529 | def test_assertion_message_escape(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 542 | def test_assertion_messages_bytes(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 548 | def test_assertion_message_verbosity(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 576 | def test_assertion_message_verbosity_collection(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 677 | def test_short_circuit_evaluation(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 752 | def test_starred_with_side_effect(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 921 | def test_assert_raising__bool__in_comparison(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 942 | def test_assert_handling_raise_in__iter__(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 985 | def test_custom_repr_non_ascii(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1061 | def test_load_resource_via_files_with_rewrite(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1271 | def test_package_without__init__py(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1288 | def test_rewrite_warning_ignore(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1304 | def test_rewrite_module_imported_from_conftest(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1338 | def test_rewrite_warning_using_pytest_plugins(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1353 | def test_rewrite_warning_using_pytest_plugins_env_var( | CODE |
| LOW | testing/test_assertrewrite.py | 1399 | def test_resources_provider_for_loader(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1686 | def test_rewrite_python_files_contain_subdirs(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1885 | def test_source_mtime_long_long(pytester: Pytester, offset) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1907 | def test_rewrite_infinite_recursion( | CODE |
| LOW | testing/test_assertrewrite.py | 2005 | def test_pattern_contains_subdirectories( | CODE |
| LOW | testing/test_assertrewrite.py | 2133 | def test_hook_not_called_without_cmd_option( | CODE |
| LOW | testing/test_assertrewrite.py | 2316 | def test_sys_pycache_prefix_integration( | CODE |
| LOW | testing/test_assertrewrite.py | 2441 | def test_assertion_failure_when_terminalreporter_is_disabled( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1731 | def test_assertion_walrus_operator_in_operand(self, pytester: Pytester) -> None: | STRING |
| LOW⚡ | testing/test_assertrewrite.py | 1741 | def test_assertion_walrus_operator_in_operand_json_dumps( | STRING |
| 2290 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | bench/bench_argcomplete.py | 5 | CODE | |
| LOW | bench/unit_test.py | 1 | CODE | |
| LOW | bench/unit_test.py | 3 | CODE | |
| LOW | bench/skip.py | 1 | CODE | |
| LOW | bench/manyparam.py | 1 | CODE | |
| LOW | bench/empty.py | 1 | CODE | |
| LOW | bench/bench.py | 1 | CODE | |
| LOW | bench/bench.py | 10 | CODE | |
| LOW | bench/xunit.py | 1 | CODE | |
| LOW | testing/test_legacypath.py | 2 | CODE | |
| LOW | testing/test_setuponly.py | 2 | CODE | |
| LOW | testing/test_assertrewrite.py | 2 | CODE | |
| LOW | testing/test_subtests.py | 1 | CODE | |
| LOW | testing/conftest.py | 2 | CODE | |
| LOW | testing/test_collect_imported_tests.py | 3 | CODE | |
| LOW | testing/test_warnings.py | 2 | CODE | |
| LOW | testing/test_warnings.py | 949 | CODE | |
| LOW | testing/test_mark.py | 2 | CODE | |
| LOW | testing/test_faulthandler.py | 2 | CODE | |
| LOW | testing/test_recwarn.py | 2 | CODE | |
| LOW | testing/test_session.py | 2 | CODE | |
| LOW | testing/test_skipping.py | 2 | CODE | |
| LOW | testing/test_python_path.py | 2 | CODE | |
| LOW | testing/test_pastebin.py | 2 | CODE | |
| LOW | testing/test_conftest.py | 2 | CODE | |
| LOW | testing/test_nodes.py | 2 | CODE | |
| LOW | testing/test_unittest.py | 2 | CODE | |
| LOW | testing/test_scope.py | 1 | CODE | |
| LOW | testing/test_setupplan.py | 1 | CODE | |
| LOW | testing/typing_checks.py | 8 | CODE | |
| LOW | testing/test_collection.py | 2 | CODE | |
| LOW | testing/test_terminal.py | 4 | CODE | |
| LOW | testing/test_threadexception.py | 1 | CODE | |
| LOW | testing/typing_raises_group.py | 1 | CODE | |
| LOW | testing/test_error_diffs.py | 8 | CODE | |
| LOW | testing/test_reports.py | 2 | CODE | |
| LOW | testing/test_pluginmanager.py | 2 | CODE | |
| LOW | testing/test_runner.py | 2 | CODE | |
| LOW | testing/test_monkeypatch.py | 2 | CODE | |
| LOW | testing/test_monkeypatch.py | 690 | CODE | |
| LOW | testing/test_doctest.py | 2 | CODE | |
| LOW | testing/test_compat.py | 2 | CODE | |
| LOW | testing/test_config.py | 2 | CODE | |
| LOW | testing/test_capture.py | 2 | CODE | |
| LOW | testing/test_parseopt.py | 2 | CODE | |
| LOW | testing/test_nodeid.py | 1 | CODE | |
| LOW | testing/test_link_resolve.py | 2 | CODE | |
| LOW | testing/test_entry_points.py | 2 | CODE | |
| LOW | testing/test_helpconfig.py | 2 | CODE | |
| LOW | testing/test_debugging.py | 2 | CODE | |
| LOW | testing/test_cacheprovider.py | 1 | CODE | |
| LOW | testing/test_meta.py | 7 | CODE | |
| LOW | testing/test_unraisableexception.py | 1 | CODE | |
| LOW | testing/test_findpaths.py | 2 | CODE | |
| LOW | testing/test_assertion.py | 2 | CODE | |
| LOW | testing/test_warning_types.py | 2 | CODE | |
| LOW | testing/test_pytester.py | 2 | CODE | |
| LOW | testing/test_argcomplete.py | 2 | CODE | |
| LOW | testing/test_mark_expression.py | 1 | CODE | |
| LOW | testing/test_main.py | 2 | CODE | |
| 295 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | testing/test_runner.py | 1040 | except IndexError: | CODE |
| HIGH | testing/test_runner.py | 472 | except pytest.exit.Exception: | CODE |
| HIGH | testing/test_runner.py | 493 | except KeyboardInterrupt: | CODE |
| HIGH | testing/test_runner.py | 521 | except KeyboardInterrupt: | CODE |
| HIGH | testing/test_assertrewrite_coverage.py | 116 | except AssertionError: | CODE |
| HIGH | testing/python/raises.py | 69 | except pytest.fail.Exception: | CODE |
| HIGH | testing/python/fixtures.py | 857 | except ImportError: | CODE |
| HIGH | testing/io/test_saferepr.py | 79 | except IndexError: | CODE |
| HIGH | testing/code/test_excinfo.py | 139 | except ValueError: | CODE |
| HIGH | testing/code/test_excinfo.py | 153 | except somenoname: # type: ignore[name-defined] # noqa: F821 | CODE |
| HIGH | src/_pytest/approx.py | 443 | except TypeError: | CODE |
| HIGH | src/_pytest/approx.py | 355 | except ZeroDivisionError: | CODE |
| HIGH | src/_pytest/logging.py | 192 | except ValueError: | CODE |
| HIGH | src/_pytest/unittest.py | 303 | except TypeError: | CODE |
| HIGH | src/_pytest/unittest.py | 513 | except AttributeError: | CODE |
| HIGH | src/_pytest/runner.py | 181 | except AttributeError: | CODE |
| HIGH | src/_pytest/compat.py | 82 | except ValueError: | CODE |
| HIGH | src/_pytest/terminal.py | 1594 | except AttributeError: | CODE |
| HIGH | src/_pytest/capture.py | 96 | except ImportError: | CODE |
| HIGH | src/_pytest/capture.py | 79 | except ImportError: | CODE |
| HIGH | src/_pytest/pytester.py | 1198 | except ValueError: | CODE |
| HIGH | src/_pytest/nodes.py | 609 | except ValueError: | CODE |
| HIGH | src/_pytest/monkeypatch.py | 75 | except AttributeError: | CODE |
| HIGH | src/_pytest/monkeypatch.py | 444 | except KeyError: | CODE |
| HIGH | src/_pytest/legacypath.py | 452 | except AttributeError: | CODE |
| HIGH | src/_pytest/pathlib.py | 260 | except OSError: | CODE |
| HIGH | src/_pytest/pathlib.py | 264 | except Exception: | CODE |
| HIGH | src/_pytest/pathlib.py | 277 | except Exception: | CODE |
| HIGH | src/_pytest/pathlib.py | 317 | except OSError: | CODE |
| HIGH | src/_pytest/pathlib.py | 599 | except CouldNotResolvePathError: | CODE |
| HIGH | src/_pytest/pathlib.py | 347 | except OSError: | CODE |
| HIGH | src/_pytest/fixtures.py | 1075 | except StopIteration: | CODE |
| HIGH | src/_pytest/config/__init__.py | 1898 | except KeyError: | CODE |
| HIGH | src/_pytest/config/__init__.py | 544 | except Exception: | CODE |
| HIGH | src/_pytest/config/__init__.py | 784 | except KeyError: | CODE |
| HIGH | src/_pytest/config/__init__.py | 1965 | except (TypeError, ValueError): | CODE |
| HIGH | src/_pytest/_code/code.py | 191 | except KeyError: | CODE |
| HIGH | src/_pytest/_code/code.py | 333 | except Exception: | CODE |
| HIGH | src/_pytest/_code/code.py | 1592 | except OSError: | CODE |
| HIGH | src/_pytest/_code/source.py | 156 | except AttributeError: | CODE |
| HIGH | src/_pytest/_code/source.py | 197 | except AttributeError: # pragma: no cover - defensive | CODE |
| HIGH | src/_pytest/_code/source.py | 251 | except Exception: | CODE |
| HIGH | src/_pytest/_io/terminalwriter.py | 81 | except ImportError: | CODE |
| HIGH | src/_pytest/_py/path.py | 1427 | except OSError: | CODE |
| HIGH | src/_pytest/_py/path.py | 1431 | except (OSError, AttributeError, NotImplementedError): | CODE |
| HIGH | src/_pytest/_py/path.py | 665 | except KeyError: | CODE |
| HIGH | src/_pytest/_py/path.py | 1365 | except error.Error: | CODE |
| HIGH | src/_pytest/_py/path.py | 1295 | except ValueError: | CODE |
| HIGH | src/_pytest/_py/path.py | 1326 | except error.Error: | CODE |
| HIGH | src/_pytest/_py/path.py | 1213 | except KeyError: | CODE |
| HIGH | src/_pytest/_py/path.py | 1235 | except error.EACCES: | CODE |
| HIGH | src/_pytest/_py/path.py | 1404 | except Exception: # this might be error.Error, WindowsError ... | CODE |
| HIGH | src/_pytest/_py/path.py | 1411 | except Exception: # this might be error.Error, WindowsError ... | CODE |
| HIGH | src/_pytest/_py/path.py | 83 | except AttributeError: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 192 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 194 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | testing/test_assertrewrite_coverage.py | 24 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | testing/test_assertrewrite_coverage.py | 26 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | testing/test_assertrewrite_coverage.py | 713 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | testing/test_assertrewrite_coverage.py | 715 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 885 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 887 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 1115 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM⚡ | testing/test_assertrewrite_coverage.py | 1117 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | testing/test_assertrewrite_coverage.py | 315 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | testing/test_assertrewrite_coverage.py | 317 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM⚡ | src/_pytest/hookspec.py | 476 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 478 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 933 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 935 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 1170 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 1172 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 48 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 50 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 155 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 158 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 221 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 223 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 588 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 590 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 832 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 834 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 887 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 889 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1009 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1011 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1199 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1201 | # ------------------------------------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testing/conftest.py | 51 | CODE | |
| LOW | testing/test_recwarn.py | 120 | CODE | |
| LOW | testing/test_recwarn.py | 227 | CODE | |
| LOW | testing/test_recwarn.py | 413 | CODE | |
| LOW | testing/python/raises.py | 243 | CODE | |
| LOW | scripts/generate-gh-release-notes.py | 22 | CODE | |
| LOW | scripts/update-plugin-list.py | 134 | CODE | |
| LOW | src/_pytest/approx.py | 774 | CODE | |
| LOW | src/_pytest/approx.py | 1095 | CODE | |
| LOW | src/_pytest/approx.py | 311 | CODE | |
| LOW | src/_pytest/approx.py | 416 | CODE | |
| LOW | src/_pytest/skipping.py | 277 | CODE | |
| LOW | src/_pytest/logging.py | 953 | CODE | |
| LOW | src/_pytest/unittest.py | 613 | CODE | |
| LOW | src/_pytest/unittest.py | 423 | CODE | |
| LOW | src/_pytest/helpconfig.py | 182 | CODE | |
| LOW | src/_pytest/terminal.py | 316 | CODE | |
| LOW | src/_pytest/terminal.py | 637 | CODE | |
| LOW | src/_pytest/terminal.py | 956 | CODE | |
| LOW | src/_pytest/terminal.py | 1178 | CODE | |
| LOW | src/_pytest/terminal.py | 1228 | CODE | |
| LOW | src/_pytest/warnings.py | 19 | CODE | |
| LOW | src/_pytest/subtests.py | 368 | CODE | |
| LOW | src/_pytest/recwarn.py | 298 | CODE | |
| LOW | src/_pytest/debugging.py | 240 | CODE | |
| LOW | src/_pytest/unraisableexception.py | 43 | CODE | |
| LOW | src/_pytest/capture.py | 718 | CODE | |
| LOW | src/_pytest/pytester.py | 285 | CODE | |
| LOW | src/_pytest/pytester.py | 1691 | CODE | |
| LOW | src/_pytest/junitxml.py | 587 | CODE | |
| LOW | src/_pytest/python.py | 240 | CODE | |
| LOW | src/_pytest/python.py | 331 | CODE | |
| LOW | src/_pytest/python.py | 420 | CODE | |
| LOW | src/_pytest/python.py | 715 | CODE | |
| LOW | src/_pytest/python.py | 919 | CODE | |
| LOW | src/_pytest/python.py | 994 | CODE | |
| LOW | src/_pytest/python.py | 1307 | CODE | |
| LOW | src/_pytest/python.py | 1572 | CODE | |
| LOW | src/_pytest/python.py | 1803 | CODE | |
| LOW | src/_pytest/reports.py | 411 | CODE | |
| LOW | src/_pytest/setuponly.py | 32 | CODE | |
| LOW | src/_pytest/raises.py | 1255 | CODE | |
| LOW | src/_pytest/threadexception.py | 34 | CODE | |
| LOW | src/_pytest/main.py | 320 | CODE | |
| LOW | src/_pytest/main.py | 567 | CODE | |
| LOW | src/_pytest/main.py | 792 | CODE | |
| LOW | src/_pytest/main.py | 926 | CODE | |
| LOW | src/_pytest/monkeypatch.py | 363 | CODE | |
| LOW | src/_pytest/pathlib.py | 835 | CODE | |
| LOW | src/_pytest/pathlib.py | 984 | CODE | |
| LOW | src/_pytest/fixtures.py | 122 | CODE | |
| LOW | src/_pytest/fixtures.py | 164 | CODE | |
| LOW | src/_pytest/fixtures.py | 286 | CODE | |
| LOW | src/_pytest/fixtures.py | 316 | CODE | |
| LOW | src/_pytest/fixtures.py | 337 | CODE | |
| LOW | src/_pytest/fixtures.py | 1686 | CODE | |
| LOW | src/_pytest/fixtures.py | 973 | CODE | |
| LOW | src/_pytest/cacheprovider.py | 262 | CODE | |
| LOW | src/_pytest/config/__init__.py | 420 | CODE | |
| LOW | src/_pytest/config/__init__.py | 763 | CODE | |
| 31 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | testing/test_unittest.py | 715 | def __call__(self, result=None): | CODE |
| LOW | testing/test_unittest.py | 720 | except Exception: | CODE |
| LOW | testing/test_unittest.py | 729 | except Exception: | CODE |
| LOW | testing/test_runner.py | 646 | except Exception as e: | CODE |
| LOW | testing/test_config.py | 3134 | except Exception as exc: | CODE |
| MEDIUM | testing/code/test_excinfo.py | 124 | def setup_method(self, method): | CODE |
| MEDIUM | testing/code/test_excinfo.py | 2167 | def f2(): | CODE |
| LOW | testing/code/test_excinfo.py | 1542 | except Exception: | CODE |
| LOW | testing/code/test_excinfo.py | 1594 | except Exception as e: | CODE |
| LOW | testing/code/test_excinfo.py | 1442 | except Exception as e: | STRING |
| LOW | testing/code/test_excinfo.py | 2170 | except Exception: | STRING |
| LOW | testing/code/test_excinfo.py | 2221 | except Exception as e: | STRING |
| LOW | testing/code/test_excinfo.py | 2226 | except Exception as e: | STRING |
| LOW | testing/logging/test_fixture.py | 295 | except Exception: | CODE |
| LOW | src/_pytest/approx.py | 262 | except Exception as e: | CODE |
| LOW | src/_pytest/skipping.py | 128 | except Exception as exc: | CODE |
| LOW | src/_pytest/skipping.py | 140 | except Exception as exc: | CODE |
| LOW | src/_pytest/unittest.py | 69 | except Exception: | CODE |
| LOW | src/_pytest/unittest.py | 160 | except Exception: | CODE |
| LOW | src/_pytest/runner.py | 185 | except Exception as e: | CODE |
| LOW | src/_pytest/compat.py | 258 | except Exception: | CODE |
| MEDIUM | src/_pytest/compat.py | 230 | def getimfunc(func): | CODE |
| LOW | src/_pytest/debugging.py | 133 | except Exception as exc: | CODE |
| LOW | src/_pytest/pytester.py | 1204 | except Exception: | CODE |
| LOW | src/_pytest/python.py | 1082 | except Exception as e: | CODE |
| LOW | src/_pytest/doctest.py | 490 | except Exception as e: | CODE |
| LOW | src/_pytest/pathlib.py | 264 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 277 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 365 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 450 | except Exception as exc: | CODE |
| LOW | src/_pytest/fixtures.py | 1096 | except Exception as e: | CODE |
| LOW | src/_pytest/fixtures.py | 2173 | except Exception: | CODE |
| MEDIUM | src/_pytest/config/__init__.py | 2325 | def _assertion_supported() -> bool: | CODE |
| LOW⚡ | src/_pytest/config/__init__.py | 961 | except Exception as e: | CODE |
| LOW⚡ | src/_pytest/config/__init__.py | 972 | except Exception as e: | CODE |
| LOW | src/_pytest/config/__init__.py | 544 | except Exception: | CODE |
| LOW | src/_pytest/config/__init__.py | 794 | except Exception as e: | CODE |
| LOW | src/_pytest/config/__init__.py | 2428 | except Exception: | STRING |
| LOW | src/_pytest/_code/code.py | 333 | except Exception: | CODE |
| LOW | src/_pytest/_code/code.py | 1183 | except Exception as e: | CODE |
| LOW | src/_pytest/_code/source.py | 131 | except Exception: | CODE |
| LOW | src/_pytest/_code/source.py | 251 | except Exception: | CODE |
| MEDIUM | src/_pytest/_code/source.py | 128 | def findsource(obj) -> tuple[Source | None, int]: | CODE |
| LOW | src/_pytest/assertion/util.py | 182 | except Exception: | STRING |
| LOW | src/_pytest/assertion/_guards.py | 41 | except Exception: | CODE |
| LOW | src/_pytest/assertion/rewrite.py | 384 | except Exception as e: | CODE |
| LOW | src/_pytest/assertion/rewrite.py | 495 | except Exception: | STRING |
| LOW | src/_pytest/assertion/rewrite.py | 513 | except Exception: | STRING |
| LOW | src/_pytest/_io/saferepr.py | 116 | except Exception as exc: | CODE |
| LOW | src/_pytest/_io/saferepr.py | 154 | except Exception as exc: | CODE |
| MEDIUM | src/_pytest/_py/path.py | 110 | def _stat(self) -> Stat: | CODE |
| LOW | src/_pytest/_py/path.py | 975 | except Exception: | CODE |
| LOW | src/_pytest/_py/path.py | 1404 | except Exception: # this might be error.Error, WindowsError ... | CODE |
| LOW | src/_pytest/_py/path.py | 1411 | except Exception: # this might be error.Error, WindowsError ... | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | testing/test_conftest.py | 382 | # Create a build directory that contains symlinks to actual files | COMMENT |
| MEDIUM⚡ | testing/test_nodes.py | 111 | # Create a path and verify it's normalized | COMMENT |
| MEDIUM | testing/test_collection.py | 1547 | # Create a broken symlink. | COMMENT |
| MEDIUM | testing/test_link_resolve.py | 17 | for c in ascii_lowercase[7:]: # Create a subst drive from H-Z. | CODE |
| MEDIUM | testing/test_stepwise.py | 28 | # Create a simple test suite. | COMMENT |
| MEDIUM⚡ | testing/test_pathlib.py | 617 | # Create a mock entry that will raise an OSError when is_file is called | COMMENT |
| MEDIUM⚡ | testing/test_pathlib.py | 791 | # Create a directory structure first without __init__.py files. | COMMENT |
| MEDIUM⚡ | testing/test_pathlib.py | 799 | # Create the __init__.py files, it should now resolve to a proper module name. | COMMENT |
| MEDIUM | testing/test_pathlib.py | 1049 | # Create the tests files, outside 'src' and the virtualenv. | COMMENT |
| MEDIUM | src/_pytest/python.py | 1487 | # Create the new calls: if we are parametrize() multiple times (by applying the decorator | COMMENT |
| MEDIUM | src/_pytest/python.py | 1844 | """This class is a stop gap solution until we evolve to have actual function | STRING |
| MEDIUM | src/_pytest/pathlib.py | 50 | # The following function, variables and comments were | COMMENT |
| MEDIUM | src/_pytest/cacheprovider.py | 52 | # This file is a cache directory tag created by pytest. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testing/conftest.py | 31 | def set_column_width(monkeypatch: pytest.MonkeyPatch) -> None: | CODE |
| LOW | testing/logging/test_fixture.py | 13 | logger = logging.getLogger(__name__) | CODE |
| LOW | src/py.py | 15 | __all__ = ["error", "path"] | CODE |
| LOW | src/pytest/__init__.py | 101 | __all__ = [ | CODE |
| LOW | src/_pytest/logging.py | 551 | def set_level(self, level: int | str, logger: str | None = None) -> None: | CODE |
| LOW | src/_pytest/logging.py | 765 | def set_log_path(self, fname: str) -> None: | CODE |
| LOW | src/_pytest/logging.py | 946 | def set_when(self, when: str | None) -> None: | CODE |
| LOW | src/_pytest/logging.py | 983 | def set_when(self, when: str) -> None: | CODE |
| LOW | src/_pytest/terminal.py | 1449 | def _set_main_color(self) -> None: | CODE |
| LOW | src/_pytest/__init__.py | 4 | __all__ = ["__version__", "version_tuple"] | CODE |
| LOW | src/_pytest/stash.py | 9 | __all__ = ["Stash", "StashKey"] | CODE |
| LOW | src/_pytest/debugging.py | 279 | def set_trace(cls, *args, **kwargs) -> None: | CODE |
| LOW | src/_pytest/capture.py | 813 | def set_fixture(self, capture_fixture: CaptureFixture[Any]) -> None: | CODE |
| LOW | src/_pytest/timing.py | 97 | __all__ = ["perf_counter", "sleep", "time"] | CODE |
| LOW | src/_pytest/stepwise.py | 96 | def update_date_to_now(self) -> None: | CODE |
| LOW | src/_pytest/junitxml.py | 682 | def update_testcase_duration(self, report: TestReport) -> None: | CODE |
| LOW | src/_pytest/raises.py | 1470 | def set_result(self, expected: int, actual: int, result: str | None) -> None: | CODE |
| LOW | src/_pytest/mark/__init__.py | 36 | __all__ = [ | CODE |
| LOW | src/_pytest/mark/expression.py | 42 | __all__ = [ | STRING |
| LOW | src/_pytest/_code/__init__.py | 16 | __all__ = [ | CODE |
| LOW | src/_pytest/assertion/rewrite.py | 94 | def set_session(self, session: Session | None) -> None: | CODE |
| LOW | src/_pytest/_io/__init__.py | 7 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | testing/test_mark.py | 881 | def test_function(): | STRING |
| LOW | testing/test_recwarn.py | 277 | def test_function(self) -> None: | CODE |
| LOW | testing/test_collection.py | 2277 | def test_function(): pass | CODE |
| LOW | testing/test_collection.py | 2329 | def test_function(): pass | CODE |
| LOW | testing/test_junitxml.py | 367 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 393 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 419 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 560 | pytester.makepyfile("def test_function(): pass") | STRING |
| LOW | testing/test_junitxml.py | 690 | def test_function(arg): | STRING |
| LOW | testing/test_junitxml.py | 984 | def test_function(arg): | STRING |
| LOW | testing/test_junitxml.py | 1017 | def test_function(arg): | STRING |
| LOW | testing/test_junitxml.py | 1051 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/collect.py | 422 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/collect.py | 434 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 449 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 635 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 665 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/metafunc.py | 1681 | def test_function(): | CODE |
| LOW | testing/python/metafunc.py | 439 | def test_function(): | CODE |
| LOW⚡ | testing/python/metafunc.py | 1504 | def test_function(a, b): | STRING |
| LOW⚡ | testing/python/metafunc.py | 1522 | def test_function(a, b): | STRING |
| LOW | testing/python/metafunc.py | 1290 | def test_function(metafunc, pytestconfig): | STRING |
| LOW | testing/python/metafunc.py | 1542 | def test_function(a, b): | STRING |
| LOW | testing/python/metafunc.py | 1617 | def test_function(a, b): | STRING |
| LOW⚡ | testing/python/fixtures.py | 1247 | def test_function(request, farg): | STRING |
| LOW | testing/python/fixtures.py | 1421 | def test_function(keywords): | STRING |
| LOW | testing/code/test_excinfo.py | 263 | def do_stuff() -> None: | CODE |
| LOW | doc/en/example/pythoncollection.py | 6 | def test_function(): | CODE |
| LOW | src/_pytest/junitxml.py | 333 | def test_function(record_property): | STRING |
| LOW | src/_pytest/mark/structures.py | 349 | def test_function(): | STRING |
| LOW | src/_pytest/mark/structures.py | 590 | def test_function(): | STRING |
| LOW | src/_pytest/assertion/rewrite.py | 796 | def helper(self, name: str, *args: ast.expr) -> ast.expr: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pyproject.toml | 461 | # pytest's own futurewarnings | COMMENT |
| LOW | pyproject.toml | 481 | # https://github.com/pytest-dev/pytest/pull/13057 | COMMENT |
| LOW | tox.ini | 21 | COMMENT | |
| LOW | testing/test_unraisableexception.py | 401 | COMMENT | |
| LOW | testing/acceptance_test.py | 761 | # ├── hello | COMMENT |
| LOW | doc/en/broken-dep-constraints.txt | 1 | # This file contains transitive dependencies that need to be pinned for some reason. | COMMENT |
| LOW | src/_pytest/deprecated.py | 121 | # | COMMENT |
| LOW | src/_pytest/tmpdir.py | 161 | # make_numbered_dir() call | COMMENT |
| LOW | src/_pytest/python.py | 1701 | # Build the NodeId explicitly from callspec (when parametrized) | COMMENT |
| LOW | src/_pytest/nodes.py | 181 | if path is None: | COMMENT |
| LOW | src/_pytest/fixtures.py | 521 | # The FixtureDefs for each fixture name statically requested by this | COMMENT |
| LOW | src/_pytest/fixtures.py | 721 | fixturedefs = self._arg2fixturedefs.get(argname, None) | COMMENT |
| LOW | src/_pytest/fixtures.py | 1141 | # The "base" node ID for the fixture. | COMMENT |
| LOW | src/_pytest/fixtures.py | 1801 | self._arg2nodeid2fixturedefs: Final[ | COMMENT |
| LOW | src/_pytest/config/__init__.py | 2021 | # files, because the file format doesn't contain type information, but | COMMENT |
| LOW | src/_pytest/_io/pprint.py | 1 | # mypy: allow-untyped-defs | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | testing/test_cacheprovider.py | 411 | # Run this again to make sure clear-cache is robust | COMMENT |
| LOW | src/_pytest/approx.py | 628 | # just return the absolute tolerance. | COMMENT |
| MEDIUM | src/_pytest/helpconfig.py | 24 | """An argparse Action that will raise a PrintHelp exception in order to skip | STRING |
| LOW | src/_pytest/debugging.py | 319 | # we can't just return `partial(pdb.runcall, testfunction)` because (on | COMMENT |
| MEDIUM | src/_pytest/capture.py | 481 | # target FD). The following approach is robust, I believe. | COMMENT |
| MEDIUM | src/_pytest/fixtures.py | 1139 | # Used for node-based matching which is more robust than string matching. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testing/test_tmpdir.py | 251 | # Check if the whole directory is removed | STRING |
| LOW | testing/test_tmpdir.py | 281 | # Check if the whole directory is kept | STRING |
| LOW | testing/test_junitxml.py | 1160 | # Check if the null byte gets replaced | COMMENT |
| LOW | src/_pytest/approx.py | 1123 | # Check if `val` is a native bool or numpy bool. | COMMENT |
| LOW | src/_pytest/unittest.py | 471 | # Check if we have non-subtest skips: if there are also sub failures, non-subtest skips are not treated in | COMMENT |
| LOW | src/_pytest/main.py | 738 | # Check if we have the common case of running | COMMENT |
| LOW | src/_pytest/fixtures.py | 1347 | # Check if fixture is an instance method (bound to instance, not class) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/_pytest/pytester_assertions.py | 37 | CODE | |
| LOW | src/_pytest/subtests.py | 73 | CODE | |
| LOW | src/_pytest/pytester.py | 602 | CODE | |
| LOW | src/_pytest/nodes.py | 584 | CODE | |
| LOW | src/_pytest/freeze_support.py | 16 | CODE | |
| LOW | src/_pytest/mark/expression.py | 247 | CODE | |
| LOW | src/_pytest/_code/code.py | 711 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/_pytest/runner.py | 214 | value = value.replace("\x00", "(null)") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/_pytest/pytester.py | 809 | Create new text file(s) in the test directory. :param ext: The extension the file(s) should use, in | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | testing/test_assertion.py | 2939 | long_text = "Lorem ipsum dolor sit amet " * 10 | CODE |
| LOW⚡ | testing/test_assertion.py | 2939 | long_text = "Lorem ipsum dolor sit amet " * 10 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/_pytest/unittest.py | 555 | # We need to check if "twisted.trial.unittest" is specifically present in sys.modules. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/_pytest/fixtures.py | 1273 | # We make sure to do this after checking for cached value to avoid | COMMENT |