diff --git a/tests/test_benchmark/conftest.py b/tests/test_benchmark/conftest.py index f62c450..73bd11a 100644 --- a/tests/test_benchmark/conftest.py +++ b/tests/test_benchmark/conftest.py @@ -25,4 +25,9 @@ def pytest_addoption(parser): @pytest.fixture def benchmark_py_file(request): fd = request.config.getoption("--benchmark-py-file", skip=True) + + if fd.tell() > 0: + # Read calls from previous tests exhaust the file descriptor + fd.seek(0) + return ast.parse(fd.read())