Skip to content

Commit

Permalink
Compatibility with upcoming pytest 5.4
Browse files Browse the repository at this point in the history
`FixtureDef.cache_result` will be always set in pytest 5.4 (pytest-dev/pytest#6737). This change makes it compatible when the new version is released while keeping it backward compatible.
  • Loading branch information
nicoddemus committed Feb 14, 2020
1 parent 84d8aca commit 290c074
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pytest/freeze fixtures/conftest.py
Expand Up @@ -29,7 +29,7 @@ def pytest_fixture_setup(fixturedef, request):
def pytest_fixture_post_finalizer(fixturedef, request):
if not request.node.nodeid:
return
if not hasattr(fixturedef, 'cached_result'):
if getattr(fixturedef, 'cached_result', None) is None:
return
file_path = construct_file_path(fixturedef, request)
with open(file_path, 'wb') as outt:
Expand Down

0 comments on commit 290c074

Please sign in to comment.