Compare commits

...

2 Commits

Author SHA1 Message Date
holger krekel
cbbcf3cbca add marker dynamically to allow "pytest" to execute nicely at repo root without warnings 2023-10-20 22:45:11 +02:00
holger krekel
d2af9df8f9 rename test files to be unambigously numbered 2023-10-20 22:39:23 +02:00
4 changed files with 6 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ def pytest_addoption(parser):
def pytest_configure(config): def pytest_configure(config):
config._benchresults = {} config._benchresults = {}
config.addinivalue_line(
"markers", "slow: mark test to require --slow option to run"
)
def pytest_runtest_setup(item): def pytest_runtest_setup(item):
@@ -79,6 +82,9 @@ def benchmark(request):
def pytest_terminal_summary(terminalreporter): def pytest_terminal_summary(terminalreporter):
tr = terminalreporter tr = terminalreporter
results = tr.config._benchresults results = tr.config._benchresults
if not results:
return
tr.section("benchmark results") tr.section("benchmark results")
float_names = 'median min max'.split() float_names = 'median min max'.split()
width = max(map(len, float_names)) width = max(map(len, float_names))

View File

@@ -1,3 +1,2 @@
[pytest] [pytest]
addopts = -vrsx --strict-markers addopts = -vrsx --strict-markers
markers = slow: mark test as slow (requires --slow option to run)