AI Slop Code RIsk Monitor

pytest-dev/pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

21.4 Elevated pattern signal View on GitHub

Maintenance and Governance Review

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.

21.4
Adjusted Signal
21.4
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
14.6K
Stars
Python
Language
119.1K
Lines of Code
286
Files
3.0K
Pattern Hits
2026-10-12
Scan Date
0.20
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 52.9/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 2525 finding(s).

Hallucinated Dependency & Supply Chain Risk 12.2/100 · LOW

Are imports declared and package/API names verified? 358 finding(s).

Agent Over-Engineering Ratio 57.9/100 · HIGH

Are wrappers, guards, and repeated structures necessary? 2521 finding(s).

PR Review Velocity Impact 76.4/100 · CRITICAL

Which changes need focused human review? 3047 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 56MEDIUM 58LOW 2933

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers2350 hits · 1607 pts
SeverityFileLineSnippetContext
LOW⚡testing/test_legacypath.py30def test_testdir_makefile_dot_prefixes_extension_silently(CODE
LOW⚡testing/test_legacypath.py38def test_testdir_makefile_ext_none_raises_type_error(testdir: Testdir) -> None:CODE
LOW⚡testing/test_legacypath.py44def test_testdir_makefile_ext_empty_string_makes_file(testdir: Testdir) -> None:CODE
LOWtesting/test_legacypath.py68def test_tmpdir_equals_tmp_path(tmpdir: LEGACY_PATH, tmp_path: Path) -> None:CODE
LOWtesting/test_legacypath.py72def test_tmpdir_always_is_realpath(pytester: pytest.Pytester) -> None:CODE
LOWtesting/test_legacypath.py94def test_fixturerequest_getmodulepath(pytester: pytest.Pytester) -> None:CODE
LOWtesting/test_legacypath.py109 def test_session_scoped_unavailable_attributes(self, session_request):CODE
LOWtesting/test_legacypath.py173def test_inifile_from_cmdline_main_hook(pytester: pytest.Pytester) -> None:STRING
LOWtesting/test_setuponly.py16def test_show_only_active_fixtures(CODE
LOWtesting/test_setuponly.py42def test_show_different_scopes(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py71def test_show_nested_fixtures(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py105def test_show_fixtures_with_autouse(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py132def test_show_fixtures_with_parameters(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py165def test_show_fixtures_with_parameter_ids(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py194def test_show_fixtures_with_parameter_ids_function(pytester: Pytester, mode) -> None:CODE
LOWtesting/test_setuponly.py214def test_dynamic_fixture_request(pytester: Pytester) -> None:CODE
LOWtesting/test_setuponly.py219 def dynamically_requested_fixture():STRING
LOWtesting/test_setuponly.py262def test_show_fixtures_and_execute_test(pytester: Pytester) -> None:CODE
LOWtesting/test_setuponly.py307def test_show_fixture_action_with_bytes(pytester: Pytester) -> None:CODE
LOW⚡testing/test_assertrewrite.py1717 def test_walrus_operator_change_value():CODE
LOW⚡testing/test_assertrewrite.py1721 def test_walrus_operator_not_override_value():CODE
LOW⚡testing/test_assertrewrite.py1763 def test_call_other_function_arg():CODE
LOW⚡testing/test_assertrewrite.py1778 def test_call_other_function_k_arg():CODE
LOW⚡testing/test_assertrewrite.py1793 def test_function_of_function():CODE
LOW⚡testing/test_assertrewrite.py1841 def test_walrus_no_double_eval_basic(self, pytester: Pytester) -> None:CODE
LOW⚡testing/test_assertrewrite.py1861 def test_walrus_no_double_eval_running_counter(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py78 def test_place_initial_imports(self) -> None:CODE
LOWtesting/test_assertrewrite.py143 def test_positions_are_preserved(self) -> None:CODE
LOWtesting/test_assertrewrite.py360 def test_rewrites_plugin_as_a_package(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py429 def test_assertrepr_compare_same_width(self, request) -> None:CODE
LOWtesting/test_assertrewrite.py449 def test_dont_rewrite_if_hasattr_fails(self, request) -> None:CODE
LOWtesting/test_assertrewrite.py475 def test_assert_already_has_message(self) -> None:CODE
LOWtesting/test_assertrewrite.py494 def test_assertion_message_multiline(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py507 def test_assertion_message_tuple(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py518 def test_assertion_message_expr(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py529 def test_assertion_message_escape(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py542 def test_assertion_messages_bytes(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py548 def test_assertion_message_verbosity(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py576 def test_assertion_message_verbosity_collection(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py677 def test_short_circuit_evaluation(self) -> None:CODE
LOWtesting/test_assertrewrite.py752 def test_starred_with_side_effect(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py921 def test_assert_raising__bool__in_comparison(self) -> None:CODE
LOWtesting/test_assertrewrite.py942 def test_assert_handling_raise_in__iter__(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py985 def test_custom_repr_non_ascii(self) -> None:CODE
LOWtesting/test_assertrewrite.py1061 def test_load_resource_via_files_with_rewrite(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1271 def test_package_without__init__py(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1288 def test_rewrite_warning_ignore(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1304 def test_rewrite_module_imported_from_conftest(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1338 def test_rewrite_warning_using_pytest_plugins(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1353 def test_rewrite_warning_using_pytest_plugins_env_var(CODE
LOWtesting/test_assertrewrite.py1399 def test_resources_provider_for_loader(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1686 def test_rewrite_python_files_contain_subdirs(self, pytester: Pytester) -> None:CODE
LOWtesting/test_assertrewrite.py1885def test_source_mtime_long_long(pytester: Pytester, offset) -> None:CODE
LOWtesting/test_assertrewrite.py1907def test_rewrite_infinite_recursion(CODE
LOWtesting/test_assertrewrite.py2005 def test_pattern_contains_subdirectories(CODE
LOWtesting/test_assertrewrite.py2133 def test_hook_not_called_without_cmd_option(CODE
LOWtesting/test_assertrewrite.py2316 def test_sys_pycache_prefix_integration(CODE
LOWtesting/test_assertrewrite.py2441def test_assertion_failure_when_terminalreporter_is_disabled(CODE
LOW⚡testing/test_assertrewrite.py1731 def test_assertion_walrus_operator_in_operand(self, pytester: Pytester) -> None:STRING
LOW⚡testing/test_assertrewrite.py1741 def test_assertion_walrus_operator_in_operand_json_dumps(STRING
2290 more matches not shown…
Unused Imports355 hits · 304 pts
SeverityFileLineSnippetContext
LOWbench/bench_argcomplete.py5CODE
LOWbench/unit_test.py1CODE
LOWbench/unit_test.py3CODE
LOWbench/skip.py1CODE
LOWbench/manyparam.py1CODE
LOWbench/empty.py1CODE
LOWbench/bench.py1CODE
LOWbench/bench.py10CODE
LOWbench/xunit.py1CODE
LOWtesting/test_legacypath.py2CODE
LOWtesting/test_setuponly.py2CODE
LOWtesting/test_assertrewrite.py2CODE
LOWtesting/test_subtests.py1CODE
LOWtesting/conftest.py2CODE
LOWtesting/test_collect_imported_tests.py3CODE
LOWtesting/test_warnings.py2CODE
LOWtesting/test_warnings.py949CODE
LOWtesting/test_mark.py2CODE
LOWtesting/test_faulthandler.py2CODE
LOWtesting/test_recwarn.py2CODE
LOWtesting/test_session.py2CODE
LOWtesting/test_skipping.py2CODE
LOWtesting/test_python_path.py2CODE
LOWtesting/test_pastebin.py2CODE
LOWtesting/test_conftest.py2CODE
LOWtesting/test_nodes.py2CODE
LOWtesting/test_unittest.py2CODE
LOWtesting/test_scope.py1CODE
LOWtesting/test_setupplan.py1CODE
LOWtesting/typing_checks.py8CODE
LOWtesting/test_collection.py2CODE
LOWtesting/test_terminal.py4CODE
LOWtesting/test_threadexception.py1CODE
LOWtesting/typing_raises_group.py1CODE
LOWtesting/test_error_diffs.py8CODE
LOWtesting/test_reports.py2CODE
LOWtesting/test_pluginmanager.py2CODE
LOWtesting/test_runner.py2CODE
LOWtesting/test_monkeypatch.py2CODE
LOWtesting/test_monkeypatch.py690CODE
LOWtesting/test_doctest.py2CODE
LOWtesting/test_compat.py2CODE
LOWtesting/test_config.py2CODE
LOWtesting/test_capture.py2CODE
LOWtesting/test_parseopt.py2CODE
LOWtesting/test_nodeid.py1CODE
LOWtesting/test_link_resolve.py2CODE
LOWtesting/test_entry_points.py2CODE
LOWtesting/test_helpconfig.py2CODE
LOWtesting/test_debugging.py2CODE
LOWtesting/test_cacheprovider.py1CODE
LOWtesting/test_meta.py7CODE
LOWtesting/test_unraisableexception.py1CODE
LOWtesting/test_findpaths.py2CODE
LOWtesting/test_assertion.py2CODE
LOWtesting/test_warning_types.py2CODE
LOWtesting/test_pytester.py2CODE
LOWtesting/test_argcomplete.py2CODE
LOWtesting/test_mark_expression.py1CODE
LOWtesting/test_main.py2CODE
295 more matches not shown…
Empty Error Handlers54 hits · 270 pts
SeverityFileLineSnippetContext
HIGHtesting/test_runner.py1040except IndexError:CODE
HIGHtesting/test_runner.py472except pytest.exit.Exception:CODE
HIGHtesting/test_runner.py493except KeyboardInterrupt:CODE
HIGHtesting/test_runner.py521except KeyboardInterrupt:CODE
HIGHtesting/test_assertrewrite_coverage.py116except AssertionError:CODE
HIGHtesting/python/raises.py69except pytest.fail.Exception:CODE
HIGHtesting/python/fixtures.py857except ImportError:CODE
HIGHtesting/io/test_saferepr.py79except IndexError:CODE
HIGHtesting/code/test_excinfo.py139except ValueError:CODE
HIGHtesting/code/test_excinfo.py153except somenoname: # type: ignore[name-defined] # noqa: F821CODE
HIGHsrc/_pytest/approx.py443except TypeError:CODE
HIGHsrc/_pytest/approx.py355except ZeroDivisionError:CODE
HIGHsrc/_pytest/logging.py192except ValueError:CODE
HIGHsrc/_pytest/unittest.py303except TypeError:CODE
HIGHsrc/_pytest/unittest.py513except AttributeError:CODE
HIGHsrc/_pytest/runner.py181except AttributeError:CODE
HIGHsrc/_pytest/compat.py82except ValueError:CODE
HIGHsrc/_pytest/terminal.py1594except AttributeError:CODE
HIGHsrc/_pytest/capture.py96except ImportError:CODE
HIGHsrc/_pytest/capture.py79except ImportError:CODE
HIGHsrc/_pytest/pytester.py1198except ValueError:CODE
HIGHsrc/_pytest/nodes.py609except ValueError:CODE
HIGHsrc/_pytest/monkeypatch.py75except AttributeError:CODE
HIGHsrc/_pytest/monkeypatch.py444except KeyError:CODE
HIGHsrc/_pytest/legacypath.py452except AttributeError:CODE
HIGHsrc/_pytest/pathlib.py260except OSError:CODE
HIGHsrc/_pytest/pathlib.py264except Exception:CODE
HIGHsrc/_pytest/pathlib.py277except Exception:CODE
HIGHsrc/_pytest/pathlib.py317except OSError:CODE
HIGHsrc/_pytest/pathlib.py599except CouldNotResolvePathError:CODE
HIGHsrc/_pytest/pathlib.py347except OSError:CODE
HIGHsrc/_pytest/fixtures.py1075except StopIteration:CODE
HIGHsrc/_pytest/config/__init__.py1898except KeyError:CODE
HIGHsrc/_pytest/config/__init__.py544except Exception:CODE
HIGHsrc/_pytest/config/__init__.py784except KeyError:CODE
HIGHsrc/_pytest/config/__init__.py1965except (TypeError, ValueError):CODE
HIGHsrc/_pytest/_code/code.py191except KeyError:CODE
HIGHsrc/_pytest/_code/code.py333except Exception:CODE
HIGHsrc/_pytest/_code/code.py1592except OSError:CODE
HIGHsrc/_pytest/_code/source.py156except AttributeError:CODE
HIGHsrc/_pytest/_code/source.py197except AttributeError: # pragma: no cover - defensiveCODE
HIGHsrc/_pytest/_code/source.py251except Exception:CODE
HIGHsrc/_pytest/_io/terminalwriter.py81except ImportError:CODE
HIGHsrc/_pytest/_py/path.py1427except OSError:CODE
HIGHsrc/_pytest/_py/path.py1431except (OSError, AttributeError, NotImplementedError):CODE
HIGHsrc/_pytest/_py/path.py665except KeyError:CODE
HIGHsrc/_pytest/_py/path.py1365except error.Error:CODE
HIGHsrc/_pytest/_py/path.py1295except ValueError:CODE
HIGHsrc/_pytest/_py/path.py1326except error.Error:CODE
HIGHsrc/_pytest/_py/path.py1213except KeyError:CODE
HIGHsrc/_pytest/_py/path.py1235except error.EACCES:CODE
HIGHsrc/_pytest/_py/path.py1404except Exception: # this might be error.Error, WindowsError ...CODE
HIGHsrc/_pytest/_py/path.py1411except Exception: # this might be error.Error, WindowsError ...CODE
HIGHsrc/_pytest/_py/path.py83except AttributeError:CODE
Decorative Section Separators34 hits · 101 pts
SeverityFileLineSnippetContext
MEDIUM⚡testing/test_assertrewrite_coverage.py192# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡testing/test_assertrewrite_coverage.py194# ---------------------------------------------------------------------------COMMENT
MEDIUMtesting/test_assertrewrite_coverage.py24# ---------------------------------------------------------------------------COMMENT
MEDIUMtesting/test_assertrewrite_coverage.py26# ---------------------------------------------------------------------------COMMENT
MEDIUMtesting/test_assertrewrite_coverage.py713# ---------------------------------------------------------------------------COMMENT
MEDIUMtesting/test_assertrewrite_coverage.py715# ---------------------------------------------------------------------------COMMENT
MEDIUM⚡testing/test_assertrewrite_coverage.py885# ---------------------------------------------------------------------------STRING
MEDIUM⚡testing/test_assertrewrite_coverage.py887# ---------------------------------------------------------------------------STRING
MEDIUM⚡testing/test_assertrewrite_coverage.py1115# ---------------------------------------------------------------------------STRING
MEDIUM⚡testing/test_assertrewrite_coverage.py1117# ---------------------------------------------------------------------------STRING
MEDIUMtesting/test_assertrewrite_coverage.py315# ---------------------------------------------------------------------------STRING
MEDIUMtesting/test_assertrewrite_coverage.py317# ---------------------------------------------------------------------------STRING
MEDIUM⚡src/_pytest/hookspec.py476# -------------------------------------------------------------------------COMMENT
MEDIUM⚡src/_pytest/hookspec.py478# -------------------------------------------------------------------------COMMENT
MEDIUM⚡src/_pytest/hookspec.py933# -------------------------------------------------------------------------COMMENT
MEDIUM⚡src/_pytest/hookspec.py935# -------------------------------------------------------------------------COMMENT
MEDIUM⚡src/_pytest/hookspec.py1170# -------------------------------------------------------------------------COMMENT
MEDIUM⚡src/_pytest/hookspec.py1172# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py48# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py50# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py155# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py158# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py221# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py223# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py588# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py590# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py832# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py834# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py887# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py889# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py1009# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py1011# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py1199# -------------------------------------------------------------------------COMMENT
MEDIUMsrc/_pytest/hookspec.py1201# -------------------------------------------------------------------------COMMENT
Deep Nesting91 hits · 76 pts
SeverityFileLineSnippetContext
LOWtesting/conftest.py51CODE
LOWtesting/test_recwarn.py120CODE
LOWtesting/test_recwarn.py227CODE
LOWtesting/test_recwarn.py413CODE
LOWtesting/python/raises.py243CODE
LOWscripts/generate-gh-release-notes.py22CODE
LOWscripts/update-plugin-list.py134CODE
LOWsrc/_pytest/approx.py774CODE
LOWsrc/_pytest/approx.py1095CODE
LOWsrc/_pytest/approx.py311CODE
LOWsrc/_pytest/approx.py416CODE
LOWsrc/_pytest/skipping.py277CODE
LOWsrc/_pytest/logging.py953CODE
LOWsrc/_pytest/unittest.py613CODE
LOWsrc/_pytest/unittest.py423CODE
LOWsrc/_pytest/helpconfig.py182CODE
LOWsrc/_pytest/terminal.py316CODE
LOWsrc/_pytest/terminal.py637CODE
LOWsrc/_pytest/terminal.py956CODE
LOWsrc/_pytest/terminal.py1178CODE
LOWsrc/_pytest/terminal.py1228CODE
LOWsrc/_pytest/warnings.py19CODE
LOWsrc/_pytest/subtests.py368CODE
LOWsrc/_pytest/recwarn.py298CODE
LOWsrc/_pytest/debugging.py240CODE
LOWsrc/_pytest/unraisableexception.py43CODE
LOWsrc/_pytest/capture.py718CODE
LOWsrc/_pytest/pytester.py285CODE
LOWsrc/_pytest/pytester.py1691CODE
LOWsrc/_pytest/junitxml.py587CODE
LOWsrc/_pytest/python.py240CODE
LOWsrc/_pytest/python.py331CODE
LOWsrc/_pytest/python.py420CODE
LOWsrc/_pytest/python.py715CODE
LOWsrc/_pytest/python.py919CODE
LOWsrc/_pytest/python.py994CODE
LOWsrc/_pytest/python.py1307CODE
LOWsrc/_pytest/python.py1572CODE
LOWsrc/_pytest/python.py1803CODE
LOWsrc/_pytest/reports.py411CODE
LOWsrc/_pytest/setuponly.py32CODE
LOWsrc/_pytest/raises.py1255CODE
LOWsrc/_pytest/threadexception.py34CODE
LOWsrc/_pytest/main.py320CODE
LOWsrc/_pytest/main.py567CODE
LOWsrc/_pytest/main.py792CODE
LOWsrc/_pytest/main.py926CODE
LOWsrc/_pytest/monkeypatch.py363CODE
LOWsrc/_pytest/pathlib.py835CODE
LOWsrc/_pytest/pathlib.py984CODE
LOWsrc/_pytest/fixtures.py122CODE
LOWsrc/_pytest/fixtures.py164CODE
LOWsrc/_pytest/fixtures.py286CODE
LOWsrc/_pytest/fixtures.py316CODE
LOWsrc/_pytest/fixtures.py337CODE
LOWsrc/_pytest/fixtures.py1686CODE
LOWsrc/_pytest/fixtures.py973CODE
LOWsrc/_pytest/cacheprovider.py262CODE
LOWsrc/_pytest/config/__init__.py420CODE
LOWsrc/_pytest/config/__init__.py763CODE
31 more matches not shown…
Excessive Try-Catch Wrapping54 hits · 55 pts
SeverityFileLineSnippetContext
MEDIUMtesting/test_unittest.py715def __call__(self, result=None):CODE
LOWtesting/test_unittest.py720 except Exception:CODE
LOWtesting/test_unittest.py729 except Exception:CODE
LOWtesting/test_runner.py646 except Exception as e:CODE
LOWtesting/test_config.py3134 except Exception as exc:CODE
MEDIUMtesting/code/test_excinfo.py124def setup_method(self, method):CODE
MEDIUMtesting/code/test_excinfo.py2167def f2():CODE
LOWtesting/code/test_excinfo.py1542 except Exception:CODE
LOWtesting/code/test_excinfo.py1594 except Exception as e:CODE
LOWtesting/code/test_excinfo.py1442 except Exception as e:STRING
LOWtesting/code/test_excinfo.py2170 except Exception:STRING
LOWtesting/code/test_excinfo.py2221 except Exception as e:STRING
LOWtesting/code/test_excinfo.py2226 except Exception as e:STRING
LOWtesting/logging/test_fixture.py295 except Exception:CODE
LOWsrc/_pytest/approx.py262 except Exception as e:CODE
LOWsrc/_pytest/skipping.py128 except Exception as exc:CODE
LOWsrc/_pytest/skipping.py140 except Exception as exc:CODE
LOWsrc/_pytest/unittest.py69 except Exception:CODE
LOWsrc/_pytest/unittest.py160 except Exception:CODE
LOWsrc/_pytest/runner.py185 except Exception as e:CODE
LOWsrc/_pytest/compat.py258 except Exception:CODE
MEDIUMsrc/_pytest/compat.py230def getimfunc(func):CODE
LOWsrc/_pytest/debugging.py133 except Exception as exc:CODE
LOWsrc/_pytest/pytester.py1204 except Exception:CODE
LOWsrc/_pytest/python.py1082 except Exception as e:CODE
LOWsrc/_pytest/doctest.py490 except Exception as e:CODE
LOWsrc/_pytest/pathlib.py264 except Exception:CODE
LOWsrc/_pytest/pathlib.py277 except Exception:CODE
LOWsrc/_pytest/pathlib.py365 except Exception:CODE
LOWsrc/_pytest/pathlib.py450 except Exception as exc:CODE
LOWsrc/_pytest/fixtures.py1096 except Exception as e:CODE
LOWsrc/_pytest/fixtures.py2173 except Exception:CODE
MEDIUMsrc/_pytest/config/__init__.py2325def _assertion_supported() -> bool:CODE
LOW⚡src/_pytest/config/__init__.py961 except Exception as e:CODE
LOW⚡src/_pytest/config/__init__.py972 except Exception as e:CODE
LOWsrc/_pytest/config/__init__.py544 except Exception:CODE
LOWsrc/_pytest/config/__init__.py794 except Exception as e:CODE
LOWsrc/_pytest/config/__init__.py2428 except Exception:STRING
LOWsrc/_pytest/_code/code.py333 except Exception:CODE
LOWsrc/_pytest/_code/code.py1183 except Exception as e:CODE
LOWsrc/_pytest/_code/source.py131 except Exception:CODE
LOWsrc/_pytest/_code/source.py251 except Exception:CODE
MEDIUMsrc/_pytest/_code/source.py128def findsource(obj) -> tuple[Source | None, int]:CODE
LOWsrc/_pytest/assertion/util.py182 except Exception:STRING
LOWsrc/_pytest/assertion/_guards.py41 except Exception:CODE
LOWsrc/_pytest/assertion/rewrite.py384 except Exception as e:CODE
LOWsrc/_pytest/assertion/rewrite.py495 except Exception:STRING
LOWsrc/_pytest/assertion/rewrite.py513 except Exception:STRING
LOWsrc/_pytest/_io/saferepr.py116 except Exception as exc:CODE
LOWsrc/_pytest/_io/saferepr.py154 except Exception as exc:CODE
MEDIUMsrc/_pytest/_py/path.py110def _stat(self) -> Stat:CODE
LOWsrc/_pytest/_py/path.py975 except Exception:CODE
LOWsrc/_pytest/_py/path.py1404 except Exception: # this might be error.Error, WindowsError ...CODE
LOWsrc/_pytest/_py/path.py1411 except Exception: # this might be error.Error, WindowsError ...CODE
Self-Referential Comments13 hits · 42 pts
SeverityFileLineSnippetContext
MEDIUMtesting/test_conftest.py382 # Create a build directory that contains symlinks to actual filesCOMMENT
MEDIUM⚡testing/test_nodes.py111 # Create a path and verify it's normalizedCOMMENT
MEDIUMtesting/test_collection.py1547 # Create a broken symlink.COMMENT
MEDIUMtesting/test_link_resolve.py17 for c in ascii_lowercase[7:]: # Create a subst drive from H-Z.CODE
MEDIUMtesting/test_stepwise.py28 # Create a simple test suite.COMMENT
MEDIUM⚡testing/test_pathlib.py617 # Create a mock entry that will raise an OSError when is_file is calledCOMMENT
MEDIUM⚡testing/test_pathlib.py791 # Create a directory structure first without __init__.py files.COMMENT
MEDIUM⚡testing/test_pathlib.py799 # Create the __init__.py files, it should now resolve to a proper module name.COMMENT
MEDIUMtesting/test_pathlib.py1049 # Create the tests files, outside 'src' and the virtualenv.COMMENT
MEDIUMsrc/_pytest/python.py1487 # Create the new calls: if we are parametrize() multiple times (by applying the decoratorCOMMENT
MEDIUMsrc/_pytest/python.py1844 """This class is a stop gap solution until we evolve to have actual functionSTRING
MEDIUMsrc/_pytest/pathlib.py50# The following function, variables and comments wereCOMMENT
MEDIUMsrc/_pytest/cacheprovider.py52# This file is a cache directory tag created by pytest.COMMENT
Modern Structural Boilerplate22 hits · 22 pts
SeverityFileLineSnippetContext
LOWtesting/conftest.py31def set_column_width(monkeypatch: pytest.MonkeyPatch) -> None:CODE
LOWtesting/logging/test_fixture.py13logger = logging.getLogger(__name__)CODE
LOWsrc/py.py15__all__ = ["error", "path"]CODE
LOWsrc/pytest/__init__.py101__all__ = [CODE
LOWsrc/_pytest/logging.py551 def set_level(self, level: int | str, logger: str | None = None) -> None:CODE
LOWsrc/_pytest/logging.py765 def set_log_path(self, fname: str) -> None:CODE
LOWsrc/_pytest/logging.py946 def set_when(self, when: str | None) -> None:CODE
LOWsrc/_pytest/logging.py983 def set_when(self, when: str) -> None:CODE
LOWsrc/_pytest/terminal.py1449 def _set_main_color(self) -> None:CODE
LOWsrc/_pytest/__init__.py4__all__ = ["__version__", "version_tuple"]CODE
LOWsrc/_pytest/stash.py9__all__ = ["Stash", "StashKey"]CODE
LOWsrc/_pytest/debugging.py279 def set_trace(cls, *args, **kwargs) -> None:CODE
LOWsrc/_pytest/capture.py813 def set_fixture(self, capture_fixture: CaptureFixture[Any]) -> None:CODE
LOWsrc/_pytest/timing.py97__all__ = ["perf_counter", "sleep", "time"]CODE
LOWsrc/_pytest/stepwise.py96 def update_date_to_now(self) -> None:CODE
LOWsrc/_pytest/junitxml.py682 def update_testcase_duration(self, report: TestReport) -> None:CODE
LOWsrc/_pytest/raises.py1470 def set_result(self, expected: int, actual: int, result: str | None) -> None:CODE
LOWsrc/_pytest/mark/__init__.py36__all__ = [CODE
LOWsrc/_pytest/mark/expression.py42__all__ = [STRING
LOWsrc/_pytest/_code/__init__.py16__all__ = [CODE
LOWsrc/_pytest/assertion/rewrite.py94 def set_session(self, session: Session | None) -> None:CODE
LOWsrc/_pytest/_io/__init__.py7__all__ = [CODE
Overly Generic Function Names32 hits · 16 pts
SeverityFileLineSnippetContext
LOW⚡testing/test_mark.py881 def test_function():STRING
LOWtesting/test_recwarn.py277 def test_function(self) -> None:CODE
LOWtesting/test_collection.py2277 def test_function(): passCODE
LOWtesting/test_collection.py2329 def test_function(): passCODE
LOWtesting/test_junitxml.py367 def test_function(arg):CODE
LOWtesting/test_junitxml.py393 def test_function(arg):CODE
LOWtesting/test_junitxml.py419 def test_function(arg):CODE
LOWtesting/test_junitxml.py560 pytester.makepyfile("def test_function(): pass")STRING
LOWtesting/test_junitxml.py690 def test_function(arg):STRING
LOWtesting/test_junitxml.py984 def test_function(arg):STRING
LOWtesting/test_junitxml.py1017 def test_function(arg):STRING
LOWtesting/test_junitxml.py1051 def test_function(arg):STRING
LOW⚡testing/python/collect.py422 def test_function(arg):STRING
LOW⚡testing/python/collect.py434 def test_function(arg):STRING
LOWtesting/python/collect.py449 def test_function(arg):STRING
LOWtesting/python/collect.py635 def test_function(arg):STRING
LOWtesting/python/collect.py665 def test_function(arg):STRING
LOW⚡testing/python/metafunc.py1681 def test_function():CODE
LOWtesting/python/metafunc.py439 def test_function():CODE
LOW⚡testing/python/metafunc.py1504 def test_function(a, b):STRING
LOW⚡testing/python/metafunc.py1522 def test_function(a, b):STRING
LOWtesting/python/metafunc.py1290 def test_function(metafunc, pytestconfig):STRING
LOWtesting/python/metafunc.py1542 def test_function(a, b):STRING
LOWtesting/python/metafunc.py1617 def test_function(a, b):STRING
LOW⚡testing/python/fixtures.py1247 def test_function(request, farg):STRING
LOWtesting/python/fixtures.py1421 def test_function(keywords):STRING
LOWtesting/code/test_excinfo.py263 def do_stuff() -> None:CODE
LOWdoc/en/example/pythoncollection.py6def test_function():CODE
LOWsrc/_pytest/junitxml.py333 def test_function(record_property):STRING
LOWsrc/_pytest/mark/structures.py349 def test_function():STRING
LOWsrc/_pytest/mark/structures.py590 def test_function():STRING
LOWsrc/_pytest/assertion/rewrite.py796 def helper(self, name: str, *args: ast.expr) -> ast.expr:CODE
Over-Commented Block16 hits · 14 pts
SeverityFileLineSnippetContext
LOWpyproject.toml461 # pytest's own futurewarningsCOMMENT
LOWpyproject.toml481 # https://github.com/pytest-dev/pytest/pull/13057COMMENT
LOWtox.ini21COMMENT
LOWtesting/test_unraisableexception.py401COMMENT
LOWtesting/acceptance_test.py761 # ├── helloCOMMENT
LOWdoc/en/broken-dep-constraints.txt1# This file contains transitive dependencies that need to be pinned for some reason.COMMENT
LOWsrc/_pytest/deprecated.py121#COMMENT
LOWsrc/_pytest/tmpdir.py161 # make_numbered_dir() callCOMMENT
LOWsrc/_pytest/python.py1701 # Build the NodeId explicitly from callspec (when parametrized)COMMENT
LOWsrc/_pytest/nodes.py181 if path is None:COMMENT
LOWsrc/_pytest/fixtures.py521 # The FixtureDefs for each fixture name statically requested by thisCOMMENT
LOWsrc/_pytest/fixtures.py721 fixturedefs = self._arg2fixturedefs.get(argname, None)COMMENT
LOWsrc/_pytest/fixtures.py1141 # The "base" node ID for the fixture.COMMENT
LOWsrc/_pytest/fixtures.py1801 self._arg2nodeid2fixturedefs: Final[COMMENT
LOWsrc/_pytest/config/__init__.py2021 # files, because the file format doesn't contain type information, butCOMMENT
LOWsrc/_pytest/_io/pprint.py1# mypy: allow-untyped-defsCOMMENT
AI Slop Vocabulary6 hits · 13 pts
SeverityFileLineSnippetContext
MEDIUMtesting/test_cacheprovider.py411 # Run this again to make sure clear-cache is robustCOMMENT
LOWsrc/_pytest/approx.py628 # just return the absolute tolerance.COMMENT
MEDIUMsrc/_pytest/helpconfig.py24 """An argparse Action that will raise a PrintHelp exception in order to skipSTRING
LOWsrc/_pytest/debugging.py319 # we can't just return `partial(pdb.runcall, testfunction)` because (onCOMMENT
MEDIUMsrc/_pytest/capture.py481 # target FD). The following approach is robust, I believe.COMMENT
MEDIUMsrc/_pytest/fixtures.py1139 # Used for node-based matching which is more robust than string matching.COMMENT
Redundant / Tautological Comments7 hits · 8 pts
SeverityFileLineSnippetContext
LOWtesting/test_tmpdir.py251 # Check if the whole directory is removedSTRING
LOWtesting/test_tmpdir.py281 # Check if the whole directory is keptSTRING
LOWtesting/test_junitxml.py1160 # Check if the null byte gets replacedCOMMENT
LOWsrc/_pytest/approx.py1123 # Check if `val` is a native bool or numpy bool.COMMENT
LOWsrc/_pytest/unittest.py471 # Check if we have non-subtest skips: if there are also sub failures, non-subtest skips are not treated inCOMMENT
LOWsrc/_pytest/main.py738 # Check if we have the common case of runningCOMMENT
LOWsrc/_pytest/fixtures.py1347 # Check if fixture is an instance method (bound to instance, not class)COMMENT
AI Structural Patterns7 hits · 7 pts
SeverityFileLineSnippetContext
LOWsrc/_pytest/pytester_assertions.py37CODE
LOWsrc/_pytest/subtests.py73CODE
LOWsrc/_pytest/pytester.py602CODE
LOWsrc/_pytest/nodes.py584CODE
LOWsrc/_pytest/freeze_support.py16CODE
LOWsrc/_pytest/mark/expression.py247CODE
LOWsrc/_pytest/_code/code.py711CODE
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHsrc/_pytest/runner.py214 value = value.replace("\x00", "(null)")CODE
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHsrc/_pytest/pytester.py809Create new text file(s) in the test directory. :param ext: The extension the file(s) should use, inSTRING
Fake / Example Data2 hits · 2 pts
SeverityFileLineSnippetContext
LOW⚡testing/test_assertion.py2939 long_text = "Lorem ipsum dolor sit amet " * 10CODE
LOW⚡testing/test_assertion.py2939 long_text = "Lorem ipsum dolor sit amet " * 10CODE
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/_pytest/unittest.py555 # We need to check if "twisted.trial.unittest" is specifically present in sys.modules.COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/_pytest/fixtures.py1273 # We make sure to do this after checking for cached value to avoidCOMMENT