Commit b0358e63 authored by Adam Blank's avatar Adam Blank
Browse files

gogo

No related merge requests found
Showing with 18 additions and 0 deletions
+18 -0
import pytest
from collections.abc import Iterable
def trans(x):
return str(x)
def apply_names(func, args, tests, noparens=False):
cases = []
for case in tests:
if not isinstance(case, Iterable):
case = [case]
extra = ", ".join(args[i] + trans(x) for i, x in enumerate(case) if (args[i] is not True and args[i] is not False))
cases.append(
pytest.param(
*case, id=func + ("(" if not noparens else "") + ", ".join(trans(x) for i, x in enumerate(case) if args[i] is True) + (")" if not noparens else "" if noparens is True else noparens) + (((", " if noparens is not True else "") + extra) if extra else "")
)
)
return cases
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment