Changeset 0e7611b in sasmodels for conftest.py
- Timestamp:
- Jan 31, 2018 6:03:03 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- b3af1c2
- Parents:
- 335271e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
conftest.py
r335271e r0e7611b 49 49 """ 50 50 if collector.istestfunction(obj, name) and is_generator(obj): 51 tests = [pytest.Function(name, parent=collector, args=yielded[1:], callobj=yielded[0]) 52 for yielded in obj()] 51 tests = [] 52 for number, yielded in enumerate(obj()): 53 index, call, args = split_yielded_test(yielded, number) 54 test = pytest.Function(name+index, collector, args=args, callobj=call) 55 tests.append(test) 53 56 return tests 54 57 58 def split_yielded_test(obj, number): 59 if not isinstance(obj, (tuple, list)): 60 obj = (obj,) 61 if not callable(obj[0]): 62 index = "['%s']"%obj[0] 63 obj = obj[1:] 64 else: 65 index = "[%d]"%number 66 call, args = obj[0], obj[1:] 67 return index, call, args 55 68 56 69 USE_DOCSTRING_AS_DESCRIPTION = True
Note: See TracChangeset
for help on using the changeset viewer.