Skip to content

Commit

Permalink
Fix issue where individual linter benchmarks were running over an emp…
Browse files Browse the repository at this point in the history
…ty file descriptor
  • Loading branch information
mschwager committed Feb 14, 2020
1 parent 26f2e06 commit 0647052
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_benchmark/conftest.py
Expand Up @@ -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())

0 comments on commit 0647052

Please sign in to comment.