MCPcopy Create free account
hub / github.com/dateutil/dateutil / add_cases

Function add_cases

tests/test_tzfile.py:745–759  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

743 cases = {}
744
745 def add_cases(f):
746 cases["offset"] = []
747 cases["utc"] = []
748 cases["varying_zones"] = []
749 f()
750
751 case_found = False
752 for key, values in cases.items():
753 case_found = True
754 id_base = f.__name__.strip("_") + "-%s"
755 for i, value in enumerate(values):
756 _real_cases[key].append(pytest.param(*value, id=id_base % i))
757
758 if not case_found: # pragma: nocover
759 raise ValueError("%s did not add any tests!" % f)
760
761 @add_cases
762 def _one_transition():

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected