diff options
author | Ran Benita <ran@unusedvar.com> | 2020-02-14 13:54:47 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-02-14 14:18:58 +0200 |
commit | d839686c7bbe9d6f8d24e69d612e737f3341b6f3 (patch) | |
tree | 1c3570eceb250536df8f64c6e2236d75f24c79b6 /src/_pytest/hookspec.py | |
parent | 56a5dbe2521d7c519c0aa44f8c8f4a8d3fe54937 (diff) | |
download | pytest-d839686c7bbe9d6f8d24e69d612e737f3341b6f3.tar.gz |
Don't delete FixtureDef.cached_result, set it to None instead
Previously `cached_result` was either set or deleted. Type annotations
cannot handle this, so use `None` for the non-set state instead.
Diffstat (limited to 'src/_pytest/hookspec.py')
-rw-r--r-- | src/_pytest/hookspec.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 3cd7f5ffe..62e2155a2 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -423,9 +423,9 @@ def pytest_fixture_setup(fixturedef, request): def pytest_fixture_post_finalizer(fixturedef, request): - """ called after fixture teardown, but before the cache is cleared so - the fixture result cache ``fixturedef.cached_result`` can - still be accessed.""" + """Called after fixture teardown, but before the cache is cleared, so + the fixture result ``fixturedef.cached_result`` is still available (not + ``None``).""" # ------------------------------------------------------------------------- |