diff --git a/changelog/6737.breaking.rst b/changelog/6737.breaking.rst index aad661e87..e024658ba 100644 --- a/changelog/6737.breaking.rst +++ b/changelog/6737.breaking.rst @@ -1,7 +1,7 @@ The ``cached_result`` attribute of ``FixtureDef`` is now set to ``None`` when the result is unavailable, instead of being deleted. -If your plugin perform checks like ``hasattr(fixturedef, 'cached_result')``, +If your plugin performs checks like ``hasattr(fixturedef, 'cached_result')``, for example in a ``pytest_fixture_post_finalizer`` hook implementation, replace it with ``fixturedef.cached_result is not None``. If you ``del`` the attribute, set it to ``None`` instead. diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 24b29a16f..f6cb17091 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -130,8 +130,6 @@ def pytest_addoption(parser): metavar="nodeid_prefix", help="deselect item (via node id prefix) during collection (multi-allowed).", ) - # when changing this to --conf-cut-dir, config.py Conftest.setinitial - # needs upgrading as well group.addoption( "--confcutdir", dest="confcutdir", diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 8aec7b818..ce1c0f651 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -262,7 +262,7 @@ class MonkeyPatch: # A call to syspathinsert() usually means that the caller wants to # import some dynamically created files, thus with python3 we # invalidate its import caches. - # This is especially important when any namespace package is in used, + # This is especially important when any namespace package is in use, # since then the mtime based FileFinder cache (that gets created in # this case already) gets not invalidated when writing the new files # quickly afterwards. diff --git a/testing/test_assertion.py b/testing/test_assertion.py index cf80fba43..453bb2fc7 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1074,9 +1074,7 @@ def test_reprcompare_notin(): def test_reprcompare_whitespaces(): - config = mock_config() - detail = plugin.pytest_assertrepr_compare(config, "==", "\r\n", "\n") - assert detail == [ + assert callequal("\r\n", "\n") == [ r"'\r\n' == '\n'", r"Strings contain only whitespace, escaping them using repr()", r"- '\n'",