We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15557b0 commit d6511e3Copy full SHA for d6511e3
src/pytest_benchmark/plugin.py
@@ -489,6 +489,11 @@ def pytest_runtest_setup(item):
489
def pytest_runtest_makereport(item, call):
490
outcome = yield
491
fixture = hasattr(item, 'funcargs') and item.funcargs.get('benchmark')
492
+ if fixture is not None and not isinstance(fixture, BenchmarkFixture):
493
+ raise TypeError(
494
+ f'unexpected type for `benchmark` in funcargs, {fixture!r} must be a BenchmarkFixture instance.'
495
+ 'You should not use other plugins that define a `benchmark` fixture, or return and unexpected value if you do redefine it.'
496
+ )
497
if fixture:
498
fixture.skipped = outcome.get_result().outcome == 'skipped'
499
0 commit comments