Changeset b3af1c2 in sasmodels
- Timestamp:
- Feb 1, 2018 5:49:11 AM (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:
- 3221de0
- Parents:
- 0e7611b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
conftest.py
r0e7611b rb3af1c2 1 1 """ 2 py .test hooks for sasmodels2 pytest hooks for sasmodels 3 3 4 Hooks for running sasmodels tests via py .test.4 Hooks for running sasmodels tests via pytest. 5 5 6 6 *pytest_collection_modifyitems* adds the test description to the end of … … 9 9 "model_tests::[3]" becomes "model_tests::[3]::bcc_paracrystal-dll". Need to 10 10 leave the "::[3]" in the name since that is the way you can indicate this 11 test specifically from the py .test command line. [This is perhaps because11 test specifically from the pytest command line. [This is perhaps because 12 12 the modifyitems hook is only called after test selection.] 13 13 … … 74 74 """ 75 75 for item in items: 76 #print(item.nodeid, type(item))77 #for attr in dir(item): not attr.startswith('__') and print(attr, getattr(item, attr))78 76 if isinstance(item, pytest.Function): 79 77 if isinstance(item, TestCaseFunction): … … 93 91 # yield args for the description 94 92 if not description and getattr(item, '_args', ()): 95 description = str(item._args) if len(item._args) > 1 else str(item._args[0])96 #print(item.nodeid, description, item._args)93 description = (str(item._args) if len(item._args) > 1 94 else str(item._args[0])) 97 95 96 # Set the description as part of the node identifier. 98 97 if description: 99 98 # Strip spaces from start and end and strip dots from end … … 102 101 # Join multi-line descriptions into a single line 103 102 if '\n' in description: 104 description = " ".join(line.strip() for line in description.split('\n')) 103 description = " ".join(line.strip() 104 for line in description.split('\n')) 105 105 106 # Set the description as part of the node identifier.107 if description:108 #print(type(item), dir(item))109 #print(item.nodeid, description)110 #print(item.location, item.name, item.nodeid, item.originalname)111 106 # Note: leave the current name mostly as-is since the prefix 112 107 # is needed to specify the nth test from a list of tests. 113 #print("updating with", description)114 108 item.name += "::" + description 115 #print("=>", item.nodeid)
Note: See TracChangeset
for help on using the changeset viewer.