Changeset b3af1c2 in sasmodels


Ignore:
Timestamp:
Feb 1, 2018 7:49:11 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

conftest.py cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • conftest.py

    r0e7611b rb3af1c2  
    11""" 
    2 py.test hooks for sasmodels 
     2pytest hooks for sasmodels 
    33 
    4 Hooks for running sasmodels tests via py.test. 
     4Hooks for running sasmodels tests via pytest. 
    55 
    66*pytest_collection_modifyitems* adds the test description to the end of 
     
    99"model_tests::[3]" becomes "model_tests::[3]::bcc_paracrystal-dll".  Need to 
    1010leave 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 because 
     11test specifically from the pytest command line. [This is perhaps because 
    1212the modifyitems hook is only called after test selection.] 
    1313 
     
    7474    """ 
    7575    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)) 
    7876        if isinstance(item, pytest.Function): 
    7977            if isinstance(item, TestCaseFunction): 
     
    9391            # yield args for the description 
    9492            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])) 
    9795 
     96            # Set the description as part of the node identifier. 
    9897            if description: 
    9998                # Strip spaces from start and end and strip dots from end 
     
    102101                # Join multi-line descriptions into a single line 
    103102                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')) 
    105105 
    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) 
    111106                # Note: leave the current name mostly as-is since the prefix 
    112107                # is needed to specify the nth test from a list of tests. 
    113                 #print("updating with", description) 
    114108                item.name += "::" + description 
    115             #print("=>", item.nodeid) 
Note: See TracChangeset for help on using the changeset viewer.