We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 222f6ff commit f338c59Copy full SHA for f338c59
pytest_trio/plugin.py
@@ -343,13 +343,13 @@ def decorator(fn):
343
@wraps(fn)
344
def wrapper(**kwargs):
345
__tracebackhide__ = True
346
- clocks = [c for c in kwargs.values() if isinstance(c, Clock)]
+ clocks = {k: c for k, c in kwargs.items() if isinstance(c, Clock)}
347
if not clocks:
348
clock = None
349
elif len(clocks) == 1:
350
- clock = clocks[0]
+ clock = list(clocks.values())[0]
351
else:
352
- raise ValueError("too many clocks spoil the broth!")
+ raise ValueError(f"Expected at most one Clock in kwargs, got {clocks!r}")
353
instruments = [
354
i for i in kwargs.values() if isinstance(i, Instrument)
355
]
0 commit comments