Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dev = [
"pytest-xdist",
"virtualenv",
"tox",
"pytest_resource_usage",
# Linting
"isort",
"pylint",
Expand Down
8 changes: 4 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ colorama==0.4.6
contourpy==1.1.1
# via matplotlib
coverage[toml]==7.3.1
# via
# coverage
# pytest-cov
# via pytest-cov
cryptography==41.0.3
# via
# adal
Expand Down Expand Up @@ -170,7 +168,6 @@ pyjwt[crypto]==2.8.0
# via
# adal
# msal
# pyjwt
pylint==3.0.1
# via tlo (pyproject.toml)
pyparsing==3.1.1
Expand All @@ -184,10 +181,13 @@ pyshp==2.3.1
pytest==7.4.2
# via
# pytest-cov
# pytest-resource-usage
# pytest-xdist
# tlo (pyproject.toml)
pytest-cov==4.1.0
# via tlo (pyproject.toml)
pytest-resource-usage==1.0.0
# via tlo (pyproject.toml)
pytest-xdist==3.3.1
# via tlo (pyproject.toml)
python-dateutil==2.8.2
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Collection of shared fixtures"""
import pkgutil

import pytest

DEFAULT_SEED = 83563095832589325021
Expand Down Expand Up @@ -31,6 +33,10 @@ def pytest_collection_modifyitems(config, items):
if "slow" in item.keywords:
item.add_marker(skip_slow)

# skip if pytest_resource_usage is not installed
if pkgutil.find_loader("pytest_resource_usage"):
for item in items:
item.add_marker(pytest.mark.report_duration)

def pytest_generate_tests(metafunc):
if "seed" in metafunc.fixturenames:
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ deps =
-r{toxinidir}/requirements/base.txt
pytest
pytest-cov
pytest-resource-usage
commands =
{posargs:pytest --cov --cov-report=term-missing -vv tests}

Expand Down