The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
2663 matches across 16 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | testing/test_legacypath.py | 30 | def test_testdir_makefile_dot_prefixes_extension_silently( |
| LOW | testing/test_legacypath.py | 38 | def test_testdir_makefile_ext_none_raises_type_error(testdir: Testdir) -> None: |
| LOW | testing/test_legacypath.py | 44 | def test_testdir_makefile_ext_empty_string_makes_file(testdir: Testdir) -> None: |
| LOW | testing/test_legacypath.py | 68 | def test_tmpdir_equals_tmp_path(tmpdir: LEGACY_PATH, tmp_path: Path) -> None: |
| LOW | testing/test_legacypath.py | 72 | def test_tmpdir_always_is_realpath(pytester: pytest.Pytester) -> None: |
| LOW | testing/test_legacypath.py | 94 | def test_fixturerequest_getmodulepath(pytester: pytest.Pytester) -> None: |
| LOW | testing/test_legacypath.py | 108 | def test_session_scoped_unavailable_attributes(self, session_request): |
| LOW | testing/test_legacypath.py | 172 | def test_inifile_from_cmdline_main_hook(pytester: pytest.Pytester) -> None: |
| LOW | testing/test_setuponly.py | 16 | def test_show_only_active_fixtures( |
| LOW | testing/test_setuponly.py | 42 | def test_show_different_scopes(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 71 | def test_show_nested_fixtures(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 105 | def test_show_fixtures_with_autouse(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 132 | def test_show_fixtures_with_parameters(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 165 | def test_show_fixtures_with_parameter_ids(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 194 | def test_show_fixtures_with_parameter_ids_function(pytester: Pytester, mode) -> None: |
| LOW | testing/test_setuponly.py | 214 | def test_dynamic_fixture_request(pytester: Pytester) -> None: |
| LOW | testing/test_setuponly.py | 219 | def dynamically_requested_fixture(): |
| LOW | testing/test_setuponly.py | 262 | def test_show_fixtures_and_execute_test(pytester: Pytester) -> None: |
| LOW | testing/test_setuponly.py | 307 | def test_show_fixture_action_with_bytes(pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1577 | def test_assertion_walrus_operator_dont_rewrite(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1596 | def test_assertion_inline_walrus_operator(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1611 | def test_assertion_inline_walrus_operator_reverse(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1626 | def test_assertion_walrus_no_variable_name_conflict( |
| LOW | testing/test_assertrewrite.py | 1640 | def test_assertion_walrus_operator_true_assertion_and_changes_variable_value( |
| LOW | testing/test_assertrewrite.py | 1654 | def test_assertion_walrus_operator_fail_assertion(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1666 | def test_assertion_walrus_operator_boolean_composite( |
| LOW | testing/test_assertrewrite.py | 1680 | def test_assertion_walrus_operator_compare_boolean_fails( |
| LOW | testing/test_assertrewrite.py | 1694 | def test_assertion_walrus_operator_boolean_none_fails( |
| LOW | testing/test_assertrewrite.py | 1708 | def test_assertion_walrus_operator_value_changes_cleared_after_each_test( |
| LOW | testing/test_assertrewrite.py | 1725 | def test_assertion_namedexpr_compare_left_overwrite( |
| LOW | testing/test_assertrewrite.py | 1767 | def test_assertion_walrus_operator_equals_operand_function( |
| LOW | testing/test_assertrewrite.py | 1782 | def test_assertion_walrus_operator_equals_operand_function_keyword_arg( |
| LOW | testing/test_assertrewrite.py | 1797 | def test_assertion_walrus_operator_equals_operand_function_arg_as_function( |
| LOW | testing/test_assertrewrite.py | 1812 | def test_assertion_walrus_operator_gt_operand_function( |
| LOW | testing/test_assertrewrite.py | 77 | def test_place_initial_imports(self) -> None: |
| LOW | testing/test_assertrewrite.py | 142 | def test_positions_are_preserved(self) -> None: |
| LOW | testing/test_assertrewrite.py | 359 | def test_rewrites_plugin_as_a_package(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 428 | def test_assertrepr_compare_same_width(self, request) -> None: |
| LOW | testing/test_assertrewrite.py | 448 | def test_dont_rewrite_if_hasattr_fails(self, request) -> None: |
| LOW | testing/test_assertrewrite.py | 474 | def test_assert_already_has_message(self) -> None: |
| LOW | testing/test_assertrewrite.py | 493 | def test_assertion_message_multiline(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 506 | def test_assertion_message_tuple(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 517 | def test_assertion_message_expr(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 528 | def test_assertion_message_escape(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 541 | def test_assertion_messages_bytes(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 547 | def test_assertion_message_verbosity(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 654 | def test_short_circuit_evaluation(self) -> None: |
| LOW | testing/test_assertrewrite.py | 729 | def test_starred_with_side_effect(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 898 | def test_assert_raising__bool__in_comparison(self) -> None: |
| LOW | testing/test_assertrewrite.py | 919 | def test_assert_handling_raise_in__iter__(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 962 | def test_custom_repr_non_ascii(self) -> None: |
| LOW | testing/test_assertrewrite.py | 1038 | def test_load_resource_via_files_with_rewrite(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1186 | def test_package_without__init__py(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1203 | def test_rewrite_warning_ignore(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1219 | def test_rewrite_module_imported_from_conftest(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1253 | def test_rewrite_warning_using_pytest_plugins(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1268 | def test_rewrite_warning_using_pytest_plugins_env_var( |
| LOW | testing/test_assertrewrite.py | 1313 | def test_resources_provider_for_loader(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1537 | def test_rewrite_python_files_contain_subdirs(self, pytester: Pytester) -> None: |
| LOW | testing/test_assertrewrite.py | 1559 | def test_assertion_walrus_operator(self, pytester: Pytester) -> None: |
| 1973 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | bench/bench_argcomplete.py | 5 | |
| LOW | bench/unit_test.py | 1 | |
| LOW | bench/unit_test.py | 3 | |
| LOW | bench/skip.py | 1 | |
| LOW | bench/manyparam.py | 1 | |
| LOW | bench/empty.py | 1 | |
| LOW | bench/bench.py | 1 | |
| LOW | bench/bench.py | 10 | |
| LOW | bench/xunit.py | 1 | |
| LOW | testing/test_legacypath.py | 2 | |
| LOW | testing/test_setuponly.py | 2 | |
| LOW | testing/test_assertrewrite.py | 2 | |
| LOW | testing/test_subtests.py | 1 | |
| LOW | testing/conftest.py | 2 | |
| LOW | testing/test_collect_imported_tests.py | 3 | |
| LOW | testing/test_warnings.py | 2 | |
| LOW | testing/test_warnings.py | 843 | |
| LOW | testing/test_mark.py | 2 | |
| LOW | testing/test_faulthandler.py | 2 | |
| LOW | testing/test_recwarn.py | 2 | |
| LOW | testing/test_session.py | 2 | |
| LOW | testing/test_skipping.py | 2 | |
| LOW | testing/test_python_path.py | 2 | |
| LOW | testing/test_pastebin.py | 2 | |
| LOW | testing/test_conftest.py | 2 | |
| LOW | testing/test_nodes.py | 2 | |
| LOW | testing/test_unittest.py | 2 | |
| LOW | testing/test_scope.py | 1 | |
| LOW | testing/test_setupplan.py | 1 | |
| LOW | testing/typing_checks.py | 8 | |
| LOW | testing/test_collection.py | 2 | |
| LOW | testing/test_terminal.py | 4 | |
| LOW | testing/test_threadexception.py | 1 | |
| LOW | testing/typing_raises_group.py | 1 | |
| LOW | testing/test_error_diffs.py | 8 | |
| LOW | testing/test_reports.py | 2 | |
| LOW | testing/test_pluginmanager.py | 2 | |
| LOW | testing/test_runner.py | 2 | |
| LOW | testing/test_monkeypatch.py | 2 | |
| LOW | testing/test_monkeypatch.py | 501 | |
| LOW | testing/test_doctest.py | 2 | |
| LOW | testing/test_compat.py | 2 | |
| LOW | testing/test_config.py | 2 | |
| LOW | testing/test_capture.py | 2 | |
| LOW | testing/test_parseopt.py | 2 | |
| LOW | testing/test_link_resolve.py | 2 | |
| LOW | testing/test_entry_points.py | 2 | |
| LOW | testing/test_helpconfig.py | 2 | |
| LOW | testing/test_debugging.py | 2 | |
| LOW | testing/test_cacheprovider.py | 1 | |
| LOW | testing/test_meta.py | 7 | |
| LOW | testing/test_unraisableexception.py | 1 | |
| LOW | testing/test_findpaths.py | 2 | |
| LOW | testing/test_assertion.py | 2 | |
| LOW | testing/test_warning_types.py | 2 | |
| LOW | testing/test_pytester.py | 2 | |
| LOW | testing/test_argcomplete.py | 2 | |
| LOW | testing/test_mark_expression.py | 1 | |
| LOW | testing/test_main.py | 2 | |
| LOW | testing/test_tmpdir.py | 2 | |
| 288 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | testing/test_assertrewrite.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_assertrewrite.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_assertrewrite.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_assertrewrite.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_assertrewrite.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_assertion.py | 0 | def test_rewritten(): assert "@py_builtins" in globals() |
| HIGH | testing/test_terminal.py | 0 | def test_one(): pass def test_two(): pass def test_three(): pass |
| HIGH | testing/test_terminal.py | 0 | def test_one(): pass def test_two(): pass def test_three(): pass |
| HIGH | testing/test_terminal.py | 0 | def test_one(): pass def test_two(): pass def test_three(): pass |
| HIGH | testing/test_terminal.py | 0 | def test_failure(): import warnings warnings.warn("warning_from_" + "test") assert 0 |
| HIGH | testing/test_terminal.py | 0 | def test_failure(): import warnings warnings.warn("warning_from_" + "test") assert 0 |
| HIGH | testing/test_terminal.py | 0 | def test_failure(): import warnings warnings.warn("warning_from_" + "test") assert 0 |
| HIGH | testing/test_reports.py | 0 | this test came originally from test_remote.py in xdist (ca03269). |
| HIGH | testing/test_reports.py | 0 | this test came originally from test_remote.py in xdist (ca03269). |
| HIGH | testing/test_reports.py | 0 | this test came originally from test_remote.py in xdist (ca03269). |
| HIGH | testing/test_config.py | 0 | def pytest_addoption(parser): parser.addini("new_name", "my option", aliases=["old_name"]) |
| HIGH | testing/test_config.py | 0 | def pytest_addoption(parser): parser.addini("new_name", "my option", aliases=["old_name"]) |
| HIGH | testing/test_config.py | 0 | def pytest_addoption(parser): parser.addini("new_name", "my option", aliases=["old_name"]) |
| HIGH | testing/test_config.py | 0 | def pytest_addoption(parser): parser.addini("new_name", "my option", aliases=["old_name"]) |
| HIGH | testing/test_tmpdir.py | 0 | [tool.pytest.ini_options] tmp_path_retention_policy = "failed" |
| HIGH | testing/test_tmpdir.py | 0 | [tool.pytest.ini_options] tmp_path_retention_policy = "failed" |
| HIGH | testing/test_tmpdir.py | 0 | [tool.pytest.ini_options] tmp_path_retention_policy = "failed" |
| HIGH | testing/test_stepwise.py | 0 | def test_1(): pass def test_2(): assert false def test_3(): pass |
| HIGH | testing/test_stepwise.py | 0 | def test_1(): pass def test_2(): assert false def test_3(): pass |
| HIGH | testing/test_stepwise.py | 0 | def test_1(): pass def test_2(): assert false def test_3(): pass |
| HIGH | testing/python/fixtures.py | 0 | import pytest @pytest.fixture def db(): pass @pytest.fixture def app(db): pass |
| HIGH | testing/python/fixtures.py | 0 | import pytest @pytest.fixture def db(): pass @pytest.fixture def app(db): pass |
| HIGH | testing/python/fixtures.py | 0 | import pytest @pytest.fixture def db(): pass @pytest.fixture def app(db): pass |
| HIGH | testing/code/test_excinfo.py | 0 | def func1(): raise valueerror("hello") def entry(): func1() |
| HIGH | testing/code/test_excinfo.py | 0 | def func1(): raise valueerror("hello") def entry(): func1() |
| HIGH | testing/code/test_excinfo.py | 0 | def func1(): raise valueerror("hello") def entry(): func1() |
| HIGH | testing/logging/test_reporting.py | 0 | import pytest import logging def test_log_file(request): plugin = request.config.pluginmanager.getplugin('logging-plugin |
| HIGH | testing/logging/test_reporting.py | 0 | import pytest import logging def test_log_file(request): plugin = request.config.pluginmanager.getplugin('logging-plugin |
| HIGH | testing/logging/test_reporting.py | 0 | import pytest import logging def test_log_file(request): plugin = request.config.pluginmanager.getplugin('logging-plugin |
| HIGH | testing/logging/test_reporting.py | 0 | import pytest import logging def test_log_file(request): plugin = request.config.pluginmanager.getplugin('logging-plugin |
| HIGH | testing/logging/test_reporting.py | 0 | import logging logger = logging.getlogger(__name__) def test_foo(): logger.warning('text') assert false |
| HIGH | testing/logging/test_reporting.py | 0 | import logging logger = logging.getlogger(__name__) def test_foo(): logger.warning('text') assert false |
| HIGH | testing/logging/test_reporting.py | 0 | import logging logger = logging.getlogger(__name__) def test_foo(): logger.warning('text') assert false |
| HIGH | testing/logging/test_reporting.py | 0 | import logging logger = logging.getlogger(__name__) def test_foo(): logger.warning('text') assert false |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | testing/conftest.py | 51 | |
| LOW | testing/test_recwarn.py | 119 | |
| LOW | testing/test_recwarn.py | 226 | |
| LOW | testing/test_recwarn.py | 412 | |
| LOW | testing/python/raises.py | 243 | |
| LOW | scripts/generate-gh-release-notes.py | 22 | |
| LOW | scripts/update-plugin-list.py | 134 | |
| LOW | src/_pytest/skipping.py | 277 | |
| LOW | src/_pytest/logging.py | 940 | |
| LOW | src/_pytest/unittest.py | 614 | |
| LOW | src/_pytest/unittest.py | 424 | |
| LOW | src/_pytest/helpconfig.py | 180 | |
| LOW | src/_pytest/terminal.py | 308 | |
| LOW | src/_pytest/terminal.py | 625 | |
| LOW | src/_pytest/terminal.py | 927 | |
| LOW | src/_pytest/terminal.py | 1148 | |
| LOW | src/_pytest/terminal.py | 1198 | |
| LOW | src/_pytest/warnings.py | 22 | |
| LOW | src/_pytest/subtests.py | 367 | |
| LOW | src/_pytest/recwarn.py | 298 | |
| LOW | src/_pytest/debugging.py | 240 | |
| LOW | src/_pytest/python_api.py | 646 | |
| LOW | src/_pytest/python_api.py | 908 | |
| LOW | src/_pytest/python_api.py | 241 | |
| LOW | src/_pytest/python_api.py | 330 | |
| LOW | src/_pytest/unraisableexception.py | 47 | |
| LOW | src/_pytest/capture.py | 712 | |
| LOW | src/_pytest/pytester.py | 285 | |
| LOW | src/_pytest/pytester.py | 1679 | |
| LOW | src/_pytest/junitxml.py | 529 | |
| LOW | src/_pytest/python.py | 220 | |
| LOW | src/_pytest/python.py | 311 | |
| LOW | src/_pytest/python.py | 400 | |
| LOW | src/_pytest/python.py | 695 | |
| LOW | src/_pytest/python.py | 899 | |
| LOW | src/_pytest/python.py | 974 | |
| LOW | src/_pytest/python.py | 1037 | |
| LOW | src/_pytest/python.py | 1230 | |
| LOW | src/_pytest/python.py | 1491 | |
| LOW | src/_pytest/python.py | 1711 | |
| LOW | src/_pytest/reports.py | 384 | |
| LOW | src/_pytest/setuponly.py | 32 | |
| LOW | src/_pytest/raises.py | 1255 | |
| LOW | src/_pytest/raises.py | 1432 | |
| LOW | src/_pytest/threadexception.py | 38 | |
| LOW | src/_pytest/main.py | 317 | |
| LOW | src/_pytest/main.py | 564 | |
| LOW | src/_pytest/main.py | 789 | |
| LOW | src/_pytest/main.py | 899 | |
| LOW | src/_pytest/monkeypatch.py | 337 | |
| LOW | src/_pytest/pathlib.py | 792 | |
| LOW | src/_pytest/pathlib.py | 941 | |
| LOW | src/_pytest/fixtures.py | 131 | |
| LOW | src/_pytest/fixtures.py | 193 | |
| LOW | src/_pytest/fixtures.py | 223 | |
| LOW | src/_pytest/fixtures.py | 244 | |
| LOW | src/_pytest/fixtures.py | 1571 | |
| LOW | src/_pytest/fixtures.py | 879 | |
| LOW | src/_pytest/fixtures.py | 1991 | |
| LOW | src/_pytest/cacheprovider.py | 249 | |
| 33 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | src/_pytest/hookspec.py | 476 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 478 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 929 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 931 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1161 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1163 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 48 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 50 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 155 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 158 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 221 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 223 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 588 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 590 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 828 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 830 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 883 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 885 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1000 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1002 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1190 | # ------------------------------------------------------------------------- |
| MEDIUM | src/_pytest/hookspec.py | 1192 | # ------------------------------------------------------------------------- |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | testing/test_unittest.py | 715 | def __call__(self, result=None): |
| LOW | testing/test_unittest.py | 720 | except Exception: |
| LOW | testing/test_unittest.py | 729 | except Exception: |
| LOW | testing/test_runner.py | 642 | except Exception as e: |
| LOW | testing/test_config.py | 2688 | except Exception as exc: |
| MEDIUM | testing/code/test_excinfo.py | 150 | def xyz(): |
| LOW | testing/code/test_excinfo.py | 1512 | except Exception: |
| LOW | testing/code/test_excinfo.py | 1564 | except Exception as e: |
| LOW | testing/code/test_excinfo.py | 1412 | except Exception as e: |
| LOW | testing/code/test_excinfo.py | 1984 | except Exception: |
| LOW | testing/logging/test_fixture.py | 261 | except Exception: |
| LOW | src/_pytest/skipping.py | 128 | except Exception as exc: |
| LOW | src/_pytest/skipping.py | 140 | except Exception as exc: |
| LOW | src/_pytest/unittest.py | 68 | except Exception: |
| LOW | src/_pytest/unittest.py | 161 | except Exception: |
| LOW | src/_pytest/runner.py | 185 | except Exception as e: |
| LOW | src/_pytest/compat.py | 257 | except Exception: |
| MEDIUM | src/_pytest/compat.py | 229 | def getimfunc(func): |
| LOW | src/_pytest/debugging.py | 133 | except Exception as exc: |
| LOW | src/_pytest/python_api.py | 211 | except Exception as e: |
| LOW | src/_pytest/pytester.py | 1192 | except Exception: |
| LOW | src/_pytest/python.py | 1018 | except Exception as e: |
| LOW | src/_pytest/doctest.py | 484 | except Exception as e: |
| LOW | src/_pytest/pathlib.py | 220 | except Exception: |
| LOW | src/_pytest/pathlib.py | 233 | except Exception: |
| LOW | src/_pytest/pathlib.py | 321 | except Exception: |
| LOW | src/_pytest/pathlib.py | 406 | except Exception as exc: |
| LOW | src/_pytest/fixtures.py | 1004 | except Exception as e: |
| MEDIUM | src/_pytest/config/__init__.py | 2070 | def _assertion_supported() -> bool: |
| LOW | src/_pytest/config/__init__.py | 511 | except Exception: |
| LOW | src/_pytest/config/__init__.py | 764 | except Exception as e: |
| LOW | src/_pytest/config/__init__.py | 2173 | except Exception: |
| LOW | src/_pytest/_code/code.py | 329 | except Exception: |
| LOW | src/_pytest/_code/code.py | 1156 | except Exception as e: |
| LOW | src/_pytest/_code/source.py | 128 | except Exception: |
| LOW | src/_pytest/_code/source.py | 217 | except Exception: |
| MEDIUM | src/_pytest/_code/source.py | 125 | def findsource(obj) -> tuple[Source | None, int]: |
| LOW | src/_pytest/assertion/util.py | 188 | except Exception: |
| LOW | src/_pytest/assertion/_guards.py | 40 | except Exception: |
| LOW | src/_pytest/assertion/rewrite.py | 394 | except Exception as e: |
| LOW | src/_pytest/assertion/rewrite.py | 475 | except Exception: |
| LOW | src/_pytest/assertion/rewrite.py | 493 | except Exception: |
| LOW | src/_pytest/_io/saferepr.py | 116 | except Exception as exc: |
| LOW | src/_pytest/_io/saferepr.py | 154 | except Exception as exc: |
| LOW | src/_pytest/_py/path.py | 975 | except Exception: |
| LOW | src/_pytest/_py/path.py | 1404 | except Exception: # this might be error.Error, WindowsError ... |
| LOW | src/_pytest/_py/path.py | 1411 | except Exception: # this might be error.Error, WindowsError ... |
| MEDIUM | src/_pytest/_py/path.py | 110 | def _stat(self) -> Stat: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | testing/test_conftest.py | 381 | # Create a build directory that contains symlinks to actual files |
| MEDIUM | testing/test_nodes.py | 111 | # Create a path and verify it's normalized |
| MEDIUM | testing/test_collection.py | 1537 | # Create a broken symlink. |
| MEDIUM | testing/test_link_resolve.py | 17 | for c in ascii_lowercase[7:]: # Create a subst drive from H-Z. |
| MEDIUM | testing/test_stepwise.py | 28 | # Create a simple test suite. |
| MEDIUM | testing/test_pathlib.py | 582 | # Create a mock entry that will raise an OSError when is_file is called |
| MEDIUM | testing/test_pathlib.py | 756 | # Create a directory structure first without __init__.py files. |
| MEDIUM | testing/test_pathlib.py | 764 | # Create the __init__.py files, it should now resolve to a proper module name. |
| MEDIUM | testing/test_pathlib.py | 1014 | # Create the tests files, outside 'src' and the virtualenv. |
| MEDIUM | src/_pytest/python.py | 1406 | # Create the new calls: if we are parametrize() multiple times (by applying the decorator |
| MEDIUM | src/_pytest/python.py | 1752 | """This class is a stop gap solution until we evolve to have actual function |
| MEDIUM | src/_pytest/pathlib.py | 49 | # The following function, variables and comments were |
| MEDIUM | src/_pytest/cacheprovider.py | 51 | # This file is a cache directory tag created by pytest. |
| MEDIUM | src/_pytest/_code/code.py | 1249 | # This class is abstract -- only subclasses are instantiated. |
| MEDIUM | src/_pytest/assertion/rewrite.py | 967 | # This method handles the 'walrus operator' repr of the target |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | testing/test_mark.py | 728 | def test_function(): |
| LOW | testing/test_recwarn.py | 276 | def test_function(self) -> None: |
| LOW | testing/test_collection.py | 2267 | def test_function(): pass |
| LOW | testing/test_collection.py | 2319 | def test_function(): pass |
| LOW | testing/test_junitxml.py | 362 | def test_function(arg): |
| LOW | testing/test_junitxml.py | 388 | def test_function(arg): |
| LOW | testing/test_junitxml.py | 414 | def test_function(arg): |
| LOW | testing/test_junitxml.py | 555 | pytester.makepyfile("def test_function(): pass") |
| LOW | testing/test_junitxml.py | 924 | def test_function(arg): |
| LOW | testing/test_junitxml.py | 954 | def test_function(arg): |
| LOW | testing/test_junitxml.py | 985 | def test_function(arg): |
| LOW | testing/python/collect.py | 396 | def test_function(arg): |
| LOW | testing/python/collect.py | 408 | def test_function(arg): |
| LOW | testing/python/collect.py | 423 | def test_function(arg): |
| LOW | testing/python/collect.py | 609 | def test_function(arg): |
| LOW | testing/python/collect.py | 639 | def test_function(arg): |
| LOW | testing/python/metafunc.py | 1572 | def test_function(): |
| LOW | testing/python/metafunc.py | 419 | def test_function(): |
| LOW | testing/python/metafunc.py | 1395 | def test_function(a, b): |
| LOW | testing/python/metafunc.py | 1413 | def test_function(a, b): |
| LOW | testing/python/metafunc.py | 1181 | def test_function(metafunc, pytestconfig): |
| LOW | testing/python/metafunc.py | 1433 | def test_function(a, b): |
| LOW | testing/python/metafunc.py | 1508 | def test_function(a, b): |
| LOW | testing/python/fixtures.py | 1169 | def test_function(request, farg): |
| LOW | testing/python/fixtures.py | 1329 | def test_function(keywords): |
| LOW | testing/code/test_excinfo.py | 263 | def do_stuff() -> None: |
| LOW | doc/en/example/pythoncollection.py | 6 | def test_function(): |
| LOW | src/_pytest/junitxml.py | 286 | def test_function(record_property): |
| LOW | src/_pytest/mark/structures.py | 334 | def test_function(): |
| LOW | src/_pytest/mark/structures.py | 590 | def test_function(): |
| LOW | src/_pytest/assertion/rewrite.py | 783 | def helper(self, name: str, *args: ast.expr) -> ast.expr: |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tox.ini | 21 | # checks that 3.11 native ExceptionGroup works with exceptiongroup |
| LOW | testing/test_config.py | 1681 | |
| LOW | testing/test_unraisableexception.py | 401 | |
| LOW | testing/acceptance_test.py | 761 | # │ ├── __init__.py |
| LOW | testing/acceptance_test.py | 841 | ) |
| LOW | doc/en/broken-dep-constraints.txt | 1 | # This file contains transitive dependencies that need to be pinned for some reason. |
| LOW | src/_pytest/deprecated.py | 101 | # ... |
| LOW | src/_pytest/tmpdir.py | 161 | from_env = os.environ.get("PYTEST_DEBUG_TEMPROOT") |
| LOW | src/_pytest/python_api.py | 461 | # If either type is non-numeric, fall back to strict equality. |
| LOW | src/_pytest/python_api.py | 861 | of raising ``TypeError``. |
| LOW | src/_pytest/fixtures.py | 421 | *, |
| LOW | src/_pytest/fixtures.py | 1041 | # Emit deprecation warning if baseid string is used when node could be provided. |
| LOW | src/_pytest/assertion/truncate.py | 61 | will be replaced by a usage message. |
| LOW | src/_pytest/_io/pprint.py | 1 | # mypy: allow-untyped-defs |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | testing/test_cacheprovider.py | 327 | # Run this again to make sure clear-cache is robust |
| MEDIUM | src/_pytest/helpconfig.py | 22 | """An argparse Action that will raise a PrintHelp exception in order to skip |
| LOW | src/_pytest/debugging.py | 319 | # we can't just return `partial(pdb.runcall, testfunction)` because (on |
| LOW | src/_pytest/python_api.py | 515 | # just return the absolute tolerance. |
| MEDIUM | src/_pytest/capture.py | 481 | # target FD). The following approach is robust, I believe. |
| MEDIUM | src/_pytest/fixtures.py | 1046 | # Used for node-based matching which is more robust than string matching. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | testing/test_tmpdir.py | 250 | # Check if the whole directory is removed |
| LOW | testing/test_tmpdir.py | 280 | # Check if the whole directory is kept |
| LOW | testing/test_junitxml.py | 1094 | # Check if the null byte gets replaced |
| LOW | src/_pytest/unittest.py | 472 | # Check if we have non-subtest skips: if there are also sub failures, non-subtest skips are not treated in |
| LOW | src/_pytest/python_api.py | 442 | # Check if `val` is a native bool or numpy bool. |
| LOW | src/_pytest/main.py | 735 | # Check if we have the common case of running |
| LOW | src/_pytest/fixtures.py | 1240 | # Check if fixture is an instance method (bound to instance, not class) |
| LOW | src/_pytest/assertion/rewrite.py | 1005 | # Check if the left operand is an ast.NamedExpr and the value has already been visited |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | src/_pytest/runner.py | 214 | value = value.replace("\x00", "(null)") |
| Severity | File | Line | Snippet |
|---|---|---|---|
| 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 |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | src/_pytest/unittest.py | 556 | # We need to check if "twisted.trial.unittest" is specifically present in sys.modules. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | src/_pytest/fixtures.py | 1171 | # We make sure to do this after checking for cached value to avoid |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | testing/test_assertion.py | 2304 | long_text = "Lorem ipsum dolor sit amet " * 10 |
| LOW | testing/test_assertion.py | 2304 | long_text = "Lorem ipsum dolor sit amet " * 10 |