Skip to content

Commit

Permalink
Use --durations-min
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Sep 6, 2023
1 parent 8e5f19d commit 942db62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hypothesis-python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def pytest_addoption(parser):
parser.addoption("--hypothesis-update-outputs", action="store_true")
parser.addoption("--hypothesis-learn-to-normalize", action="store_true")

# New in pytest 6, so we add a shim on old versions to avoid missing-arg errors
arg = "--durations-min"
if arg not in sum((a._long_opts for g in parser._groups for a in g.options), []):
parser.addoption(arg, action="store", default=1.0)


@pytest.fixture(scope="function", autouse=True)
def _gc_before_each_test():
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ addopts =
-p pytester
--runpytest=subprocess
--durations=20
--durations-min=1.0
xfail_strict = True
filterwarnings =
error
Expand Down

0 comments on commit 942db62

Please sign in to comment.