The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
This report presents the forensic synthetic code analysis of pytest-dev/pytest, a Python project with 14,346 GitHub stars. SynthScan v2.0 examined 110,960 lines of code across 281 source files, recording 2690 pattern matches distributed across 17 syntactic categories. The overall adjusted score of 18.8 places this repository in the Moderate AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 2690 distinct pattern matches across 17 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| 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 | 108 | def test_session_scoped_unavailable_attributes(self, session_request): | CODE |
| LOW | testing/test_legacypath.py | 172 | 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 | 1577 | def test_assertion_walrus_operator_dont_rewrite(self, pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1596 | def test_assertion_inline_walrus_operator(self, pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1611 | def test_assertion_inline_walrus_operator_reverse(self, pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1626 | def test_assertion_walrus_no_variable_name_conflict( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1640 | def test_assertion_walrus_operator_true_assertion_and_changes_variable_value( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1654 | def test_assertion_walrus_operator_fail_assertion(self, pytester: Pytester) -> None: | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1666 | def test_assertion_walrus_operator_boolean_composite( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1680 | def test_assertion_walrus_operator_compare_boolean_fails( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1694 | def test_assertion_walrus_operator_boolean_none_fails( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1708 | def test_assertion_walrus_operator_value_changes_cleared_after_each_test( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1725 | def test_assertion_namedexpr_compare_left_overwrite( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1767 | def test_assertion_walrus_operator_equals_operand_function( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1782 | def test_assertion_walrus_operator_equals_operand_function_keyword_arg( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1797 | def test_assertion_walrus_operator_equals_operand_function_arg_as_function( | CODE |
| LOW⚡ | testing/test_assertrewrite.py | 1812 | def test_assertion_walrus_operator_gt_operand_function( | CODE |
| LOW | testing/test_assertrewrite.py | 77 | def test_place_initial_imports(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 142 | def test_positions_are_preserved(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 359 | def test_rewrites_plugin_as_a_package(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 428 | def test_assertrepr_compare_same_width(self, request) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 448 | def test_dont_rewrite_if_hasattr_fails(self, request) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 474 | def test_assert_already_has_message(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 493 | def test_assertion_message_multiline(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 506 | def test_assertion_message_tuple(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 517 | def test_assertion_message_expr(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 528 | def test_assertion_message_escape(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 541 | def test_assertion_messages_bytes(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 547 | def test_assertion_message_verbosity(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 654 | def test_short_circuit_evaluation(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 729 | def test_starred_with_side_effect(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 898 | def test_assert_raising__bool__in_comparison(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 919 | def test_assert_handling_raise_in__iter__(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 962 | def test_custom_repr_non_ascii(self) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1038 | def test_load_resource_via_files_with_rewrite(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1186 | def test_package_without__init__py(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1203 | def test_rewrite_warning_ignore(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1219 | def test_rewrite_module_imported_from_conftest(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1253 | def test_rewrite_warning_using_pytest_plugins(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1268 | def test_rewrite_warning_using_pytest_plugins_env_var( | CODE |
| LOW | testing/test_assertrewrite.py | 1313 | def test_resources_provider_for_loader(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1537 | def test_rewrite_python_files_contain_subdirs(self, pytester: Pytester) -> None: | CODE |
| LOW | testing/test_assertrewrite.py | 1559 | def test_assertion_walrus_operator(self, pytester: Pytester) -> None: | CODE |
| 2009 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 | 843 | 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 | 501 | 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_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 | |
| LOW | testing/test_tmpdir.py | 2 | CODE | |
| 290 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testing/conftest.py | 51 | CODE | |
| LOW | testing/test_recwarn.py | 119 | CODE | |
| LOW | testing/test_recwarn.py | 226 | CODE | |
| LOW | testing/test_recwarn.py | 412 | 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 | 721 | CODE | |
| LOW | src/_pytest/approx.py | 980 | CODE | |
| LOW | src/_pytest/approx.py | 272 | CODE | |
| LOW | src/_pytest/approx.py | 373 | CODE | |
| LOW | src/_pytest/skipping.py | 277 | CODE | |
| LOW | src/_pytest/logging.py | 940 | CODE | |
| LOW | src/_pytest/unittest.py | 615 | CODE | |
| LOW | src/_pytest/unittest.py | 425 | CODE | |
| LOW | src/_pytest/helpconfig.py | 180 | CODE | |
| LOW | src/_pytest/terminal.py | 308 | CODE | |
| LOW | src/_pytest/terminal.py | 625 | CODE | |
| LOW | src/_pytest/terminal.py | 927 | CODE | |
| LOW | src/_pytest/terminal.py | 1148 | CODE | |
| LOW | src/_pytest/terminal.py | 1198 | CODE | |
| LOW | src/_pytest/warnings.py | 22 | CODE | |
| LOW | src/_pytest/subtests.py | 367 | CODE | |
| LOW | src/_pytest/recwarn.py | 298 | CODE | |
| LOW | src/_pytest/debugging.py | 240 | CODE | |
| LOW | src/_pytest/unraisableexception.py | 47 | CODE | |
| LOW | src/_pytest/capture.py | 712 | CODE | |
| LOW | src/_pytest/pytester.py | 285 | CODE | |
| LOW | src/_pytest/pytester.py | 1679 | CODE | |
| LOW | src/_pytest/junitxml.py | 529 | CODE | |
| LOW | src/_pytest/python.py | 220 | CODE | |
| LOW | src/_pytest/python.py | 311 | CODE | |
| LOW | src/_pytest/python.py | 400 | CODE | |
| LOW | src/_pytest/python.py | 695 | CODE | |
| LOW | src/_pytest/python.py | 899 | CODE | |
| LOW | src/_pytest/python.py | 974 | CODE | |
| LOW | src/_pytest/python.py | 1037 | CODE | |
| LOW | src/_pytest/python.py | 1231 | CODE | |
| LOW | src/_pytest/python.py | 1492 | CODE | |
| LOW | src/_pytest/python.py | 1714 | CODE | |
| LOW | src/_pytest/reports.py | 384 | CODE | |
| LOW | src/_pytest/setuponly.py | 32 | CODE | |
| LOW | src/_pytest/raises.py | 1255 | CODE | |
| LOW | src/_pytest/raises.py | 1432 | CODE | |
| LOW | src/_pytest/threadexception.py | 38 | CODE | |
| LOW | src/_pytest/main.py | 317 | CODE | |
| LOW | src/_pytest/main.py | 564 | CODE | |
| LOW | src/_pytest/main.py | 789 | CODE | |
| LOW | src/_pytest/main.py | 899 | CODE | |
| LOW | src/_pytest/monkeypatch.py | 337 | CODE | |
| LOW | src/_pytest/pathlib.py | 792 | CODE | |
| LOW | src/_pytest/pathlib.py | 941 | CODE | |
| LOW | src/_pytest/fixtures.py | 121 | CODE | |
| LOW | src/_pytest/fixtures.py | 163 | CODE | |
| LOW | src/_pytest/fixtures.py | 225 | CODE | |
| LOW | src/_pytest/fixtures.py | 255 | CODE | |
| LOW | src/_pytest/fixtures.py | 276 | CODE | |
| LOW | src/_pytest/fixtures.py | 1614 | CODE | |
| LOW | src/_pytest/fixtures.py | 911 | CODE | |
| LOW | src/_pytest/cacheprovider.py | 249 | CODE | |
| 31 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | src/_pytest/hookspec.py | 476 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 478 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 929 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 931 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 1161 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | src/_pytest/hookspec.py | 1163 | # ------------------------------------------------------------------------- | 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 | 828 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 830 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 883 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 885 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1000 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1002 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1190 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | src/_pytest/hookspec.py | 1192 | # ------------------------------------------------------------------------- | COMMENT |
| 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 | 642 | except Exception as e: | CODE |
| LOW | testing/test_config.py | 2710 | except Exception as exc: | CODE |
| MEDIUM | testing/code/test_excinfo.py | 150 | def xyz(): | CODE |
| LOW | testing/code/test_excinfo.py | 1512 | except Exception: | CODE |
| LOW | testing/code/test_excinfo.py | 1564 | except Exception as e: | CODE |
| LOW | testing/code/test_excinfo.py | 1412 | except Exception as e: | STRING |
| LOW | testing/code/test_excinfo.py | 1984 | except Exception: | STRING |
| LOW | testing/logging/test_fixture.py | 261 | except Exception: | CODE |
| LOW | src/_pytest/approx.py | 226 | 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 | 162 | except Exception: | CODE |
| LOW | src/_pytest/runner.py | 185 | except Exception as e: | CODE |
| LOW | src/_pytest/compat.py | 257 | except Exception: | CODE |
| MEDIUM | src/_pytest/compat.py | 229 | def getimfunc(func): | CODE |
| LOW | src/_pytest/debugging.py | 133 | except Exception as exc: | CODE |
| LOW | src/_pytest/pytester.py | 1192 | except Exception: | CODE |
| LOW | src/_pytest/python.py | 1018 | except Exception as e: | CODE |
| LOW | src/_pytest/doctest.py | 484 | except Exception as e: | CODE |
| LOW | src/_pytest/pathlib.py | 220 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 233 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 321 | except Exception: | CODE |
| LOW | src/_pytest/pathlib.py | 406 | except Exception as exc: | CODE |
| LOW | src/_pytest/fixtures.py | 1036 | except Exception as e: | CODE |
| MEDIUM | src/_pytest/config/__init__.py | 2070 | def _assertion_supported() -> bool: | CODE |
| LOW | src/_pytest/config/__init__.py | 511 | except Exception: | CODE |
| LOW | src/_pytest/config/__init__.py | 764 | except Exception as e: | CODE |
| LOW | src/_pytest/config/__init__.py | 2173 | except Exception: | STRING |
| LOW | src/_pytest/_code/code.py | 331 | except Exception: | CODE |
| LOW | src/_pytest/_code/code.py | 1172 | except Exception as e: | CODE |
| LOW | src/_pytest/_code/source.py | 128 | except Exception: | CODE |
| LOW | src/_pytest/_code/source.py | 217 | except Exception: | CODE |
| MEDIUM | src/_pytest/_code/source.py | 125 | def findsource(obj) -> tuple[Source | None, int]: | CODE |
| LOW | src/_pytest/assertion/util.py | 206 | except Exception: | STRING |
| LOW | src/_pytest/assertion/_guards.py | 41 | except Exception: | CODE |
| LOW | src/_pytest/assertion/rewrite.py | 394 | except Exception as e: | CODE |
| LOW | src/_pytest/assertion/rewrite.py | 475 | except Exception: | STRING |
| LOW | src/_pytest/assertion/rewrite.py | 493 | 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 |
| 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 |
| MEDIUM | src/_pytest/_py/path.py | 110 | def _stat(self) -> Stat: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | testing/test_conftest.py | 381 | # 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 | 1537 | # 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 | 582 | # Create a mock entry that will raise an OSError when is_file is called | COMMENT |
| MEDIUM⚡ | testing/test_pathlib.py | 756 | # Create a directory structure first without __init__.py files. | COMMENT |
| MEDIUM⚡ | testing/test_pathlib.py | 764 | # Create the __init__.py files, it should now resolve to a proper module name. | COMMENT |
| MEDIUM | testing/test_pathlib.py | 1014 | # Create the tests files, outside 'src' and the virtualenv. | COMMENT |
| MEDIUM | src/_pytest/python.py | 1407 | # Create the new calls: if we are parametrize() multiple times (by applying the decorator | COMMENT |
| MEDIUM | src/_pytest/python.py | 1755 | """This class is a stop gap solution until we evolve to have actual function | STRING |
| MEDIUM | src/_pytest/pathlib.py | 49 | # The following function, variables and comments were | COMMENT |
| MEDIUM | src/_pytest/cacheprovider.py | 51 | # This file is a cache directory tag created by pytest. | COMMENT |
| MEDIUM | src/_pytest/assertion/rewrite.py | 967 | # This method handles the 'walrus operator' repr of the target | 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 | 100 | __all__ = [ | CODE |
| LOW | src/_pytest/logging.py | 544 | def set_level(self, level: int | str, logger: str | None = None) -> None: | CODE |
| LOW | src/_pytest/logging.py | 752 | def set_log_path(self, fname: str) -> None: | CODE |
| LOW | src/_pytest/logging.py | 933 | def set_when(self, when: str | None) -> None: | CODE |
| LOW | src/_pytest/logging.py | 970 | def set_when(self, when: str) -> None: | CODE |
| LOW | src/_pytest/terminal.py | 1416 | 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 | 807 | 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 | 95 | def update_date_to_now(self) -> None: | CODE |
| LOW | src/_pytest/junitxml.py | 624 | def update_testcase_duration(self, report: TestReport) -> None: | CODE |
| LOW | src/_pytest/raises.py | 1468 | def set_result(self, expected: int, actual: int, result: str | None) -> None: | CODE |
| LOW | src/_pytest/mark/__init__.py | 35 | __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 | 95 | 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 | 728 | def test_function(): | STRING |
| LOW | testing/test_recwarn.py | 276 | def test_function(self) -> None: | CODE |
| LOW | testing/test_collection.py | 2267 | def test_function(): pass | CODE |
| LOW | testing/test_collection.py | 2319 | def test_function(): pass | CODE |
| LOW | testing/test_junitxml.py | 362 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 388 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 414 | def test_function(arg): | CODE |
| LOW | testing/test_junitxml.py | 555 | pytester.makepyfile("def test_function(): pass") | STRING |
| LOW | testing/test_junitxml.py | 924 | def test_function(arg): | STRING |
| LOW | testing/test_junitxml.py | 954 | def test_function(arg): | STRING |
| LOW | testing/test_junitxml.py | 985 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/collect.py | 396 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/collect.py | 408 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 423 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 609 | def test_function(arg): | STRING |
| LOW | testing/python/collect.py | 639 | def test_function(arg): | STRING |
| LOW⚡ | testing/python/metafunc.py | 1575 | def test_function(): | CODE |
| LOW | testing/python/metafunc.py | 422 | def test_function(): | CODE |
| LOW⚡ | testing/python/metafunc.py | 1398 | def test_function(a, b): | STRING |
| LOW⚡ | testing/python/metafunc.py | 1416 | def test_function(a, b): | STRING |
| LOW | testing/python/metafunc.py | 1184 | def test_function(metafunc, pytestconfig): | STRING |
| LOW | testing/python/metafunc.py | 1436 | def test_function(a, b): | STRING |
| LOW | testing/python/metafunc.py | 1511 | def test_function(a, b): | STRING |
| LOW⚡ | testing/python/fixtures.py | 1169 | def test_function(request, farg): | STRING |
| LOW | testing/python/fixtures.py | 1342 | 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 | 286 | def test_function(record_property): | STRING |
| LOW | src/_pytest/mark/structures.py | 333 | def test_function(): | STRING |
| LOW | src/_pytest/mark/structures.py | 574 | def test_function(): | STRING |
| LOW | src/_pytest/assertion/rewrite.py | 783 | def helper(self, name: str, *args: ast.expr) -> ast.expr: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | pyproject.toml | 401 | # Those are caught/handled by pyupgrade, and not easy to filter with the | COMMENT |
| LOW | tox.ini | 21 | # checks that 3.11 native ExceptionGroup works with exceptiongroup | COMMENT |
| LOW | testing/test_config.py | 1701 | # it should load if it's enabled, or we haven't disabled autoloading | COMMENT |
| LOW | testing/test_unraisableexception.py | 401 | COMMENT | |
| LOW | testing/acceptance_test.py | 761 | # │ ├── __init__.py | COMMENT |
| LOW | testing/acceptance_test.py | 841 | ) | 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/approx.py | 941 | # The primary responsibility of these classes is to implement ``__eq__()`` | COMMENT |
| LOW | src/_pytest/deprecated.py | 101 | # ... | COMMENT |
| LOW | src/_pytest/tmpdir.py | 161 | from_env = os.environ.get("PYTEST_DEBUG_TEMPROOT") | COMMENT |
| LOW | src/_pytest/fixtures.py | 461 | # item (computed during collection). Dynamically requested fixtures | COMMENT |
| LOW | src/_pytest/fixtures.py | 661 | # We arrive here because of a dynamic call to | COMMENT |
| LOW | src/_pytest/fixtures.py | 1081 | # The "base" node ID for the fixture. | COMMENT |
| LOW | src/_pytest/assertion/truncate.py | 61 | COMMENT | |
| LOW | src/_pytest/_io/pprint.py | 1 | # mypy: allow-untyped-defs | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testing/test_tmpdir.py | 250 | # Check if the whole directory is removed | STRING |
| LOW | testing/test_tmpdir.py | 280 | # Check if the whole directory is kept | STRING |
| LOW | testing/test_junitxml.py | 1094 | # Check if the null byte gets replaced | COMMENT |
| LOW | src/_pytest/approx.py | 998 | # Check if `val` is a native bool or numpy bool. | COMMENT |
| LOW | src/_pytest/unittest.py | 473 | # 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 | 735 | # Check if we have the common case of running | COMMENT |
| LOW | src/_pytest/fixtures.py | 1283 | # Check if fixture is an instance method (bound to instance, not class) | COMMENT |
| LOW | src/_pytest/fixtures.py | 2000 | # Insert the fixturedef into the list while maintaining a partial order | COMMENT |
| LOW | src/_pytest/assertion/rewrite.py | 1005 | # Check if the left operand is an ast.NamedExpr and the value has already been visited | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | testing/test_cacheprovider.py | 327 | # Run this again to make sure clear-cache is robust | STRING |
| LOW | src/_pytest/approx.py | 568 | # just return the absolute tolerance. | COMMENT |
| MEDIUM | src/_pytest/helpconfig.py | 22 | """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 | 1079 | # Used for node-based matching which is more robust than string matching. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/_pytest/pytester_assertions.py | 37 | CODE | |
| LOW | src/_pytest/subtests.py | 72 | CODE | |
| LOW | src/_pytest/pytester.py | 593 | CODE | |
| LOW | src/_pytest/nodes.py | 555 | CODE | |
| LOW | src/_pytest/freeze_support.py | 16 | CODE | |
| LOW | src/_pytest/mark/expression.py | 245 | CODE | |
| LOW | src/_pytest/_code/code.py | 701 | 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 | 797 | 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 | 2369 | long_text = "Lorem ipsum dolor sit amet " * 10 | CODE |
| LOW⚡ | testing/test_assertion.py | 2369 | long_text = "Lorem ipsum dolor sit amet " * 10 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/_pytest/unittest.py | 557 | # 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 | 1213 | # We make sure to do this after checking for cached value to avoid | COMMENT |