Minor cosmetic fixes (#6792)

This commit is contained in:
Daniel Hahler 2020-02-22 19:24:41 +01:00 committed by GitHub
commit 68fe0eb8f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 7 deletions

View File

@ -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.

View File

@ -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",

View File

@ -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.

View File

@ -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'",