def setUpModule(): if not grendel.get_env_bool("GRENDEL_TEST_NO_CHECK", False): grendel.type_checking_enabled = True grendel.sanity_checking_enabled = True
raise NameError("Generated function name {testname} does" " not match the test name pattern and" " thus will not be detected as a test. (Test" " function names must contain a match of" " {testre})".format( testname=_generated_test.__name__, testre=test_regex )) setattr(cls, _generated_test.__name__, _generated_test) delattr(cls, gen_name) return cls # a simple shorthand that may be a bit more readable... generator=classmethod #--------------------------------------------------------------------------------# # Get some environment variables do_long_tests = grendel.get_env_bool('GRENDEL_LONG_TESTS', False) hide_skipped_tests = grendel.get_env_bool('GRENDEL_HIDE_SKIPPED', False) #--------------------------------------------------------------------------------# # Skip more gracefully... def pretty_skip(msg_or_f): if callable(msg_or_f): if hide_skipped_tests: ret_val = unittest.skip(msg_or_f) ret_val.__name__ = '_pretty_skipped_function' return ret_val else: return unittest.skip(msg_or_f) else: def decorate_it(f): if hide_skipped_tests: ret_val = unittest.skip(msg_or_f)
"Generated function name {testname} does" " not match the test name pattern and" " thus will not be detected as a test. (Test" " function names must contain a match of" " {testre})".format(testname=_generated_test.__name__, testre=test_regex)) setattr(cls, _generated_test.__name__, _generated_test) delattr(cls, gen_name) return cls # a simple shorthand that may be a bit more readable... generator = classmethod #--------------------------------------------------------------------------------# # Get some environment variables do_long_tests = grendel.get_env_bool('GRENDEL_LONG_TESTS', False) hide_skipped_tests = grendel.get_env_bool('GRENDEL_HIDE_SKIPPED', False) #--------------------------------------------------------------------------------# # Skip more gracefully... def pretty_skip(msg_or_f): if callable(msg_or_f): if hide_skipped_tests: ret_val = unittest.skip(msg_or_f) ret_val.__name__ = '_pretty_skipped_function' return ret_val else: return unittest.skip(msg_or_f) else: