def test_checks_functions(): """ Test resetting of the tests and loading new ones """ cfg = Config(TEST_CONFIG) assert len(cfg.configuration['Checks']) == 20 cfg.reset_checks() assert len(cfg.configuration['Checks']) == 0 cfg.add_check('TagsCheck') assert len(cfg.configuration['Checks']) == 1 cfg.add_check('CompleteFakeTestsThatDoesNotExist') assert len(cfg.configuration['Checks']) == 1
config_overrides[kv[0]] = None else: config_overrides[kv[0]] = eval(kv[1]) # apply config overrides for key, value in config_overrides.items(): cfg.configuration[key] = value if not extract_dir: extract_dir = tempfile.gettempdir() if info_error: cfg.info = True output = Filter(cfg) for c in checks: cfg.add_check(c) for c in cfg.configuration['Checks']: loadCheck(c, cfg, output) for e in sorted(info_error): print('{}:'.format(e)) print(output.get_description(e)) sys.exit(0) # if no argument print usage if not args: usage(argv0) sys.exit(1) if __name__ == '__main__': if checks: cfg.reset_checks()