def test_gen(tests, generator): '''Run the given tests amending their names according to the context. Tests suites are run repeatedly under different conditions, such as data center version as defined by OST_DC_VERSION environment variable. This helper amends the run time test names to contain information about the environment under which they were run. Arguments: test_names -- sequence of names of the tests to run generator -- the calling test generator function providing test names to nose ''' ost_dc_version = os.environ.get('OST_DC_VERSION', None) for t in testlib.test_sequence_gen(tests): test_id = t.description if ost_dc_version is not None: test_id = '{}_{}'.format(test_id, ost_dc_version.replace('.', '')) generator.__name__ = test_id yield t
def test_gen(): for t in testlib.test_sequence_gen(_TEST_LIST): test_gen.__name__ = t.description yield t
def test_gen(): if USE_VDSMFAKE: _TEST_LIST.insert(0, vdsmfake_setup) for t in testlib.test_sequence_gen(_TEST_LIST): test_gen.__name__ = t.description yield t