Skip to content

Commit a6b0857

Browse files
mgornysethmlarson
authored andcommitted
Set session scope for 'one_compressed_file' fixture
Set session scope for the 'one_compressed_file' fixture to fix hypothesis health check: ``` E hypothesis.errors.FailedHealthCheck: test/test_simple_compression.py::test_streaming_compression_flush uses the 'one_compressed_file' fixture, which is reset between function calls but not between test cases generated by `@given(...)`. You can change it to a module- or session-scoped fixture if it is safe to reuse; if not we recommend using a context manager inside your test function. See https://docs.pytest.org/en/latest/fixture.html#sharing-test-data for details on fixture scope. E See https://hypothesis.readthedocs.io/en/latest/healthchecks.html for more information about this. If you want to disable just this health check, add HealthCheck.function_scoped_fixture to the suppress_health_check settings for this test. ```
1 parent 93db010 commit a6b0857

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ def simple_compressed_file(request):
2525
return (file[:-len('.compressed')], file)
2626

2727

28-
@pytest.fixture()
28+
@pytest.fixture(scope='session')
2929
def one_compressed_file():
3030
return os.path.join(TEST_DATA_DIR, 'alice29.txt')

0 commit comments

Comments
 (0)