def get_test_index(args): test_index_path = os.path.join(get_config_dir(), TEST_INDEX_FORMAT.format(args.profile)) test_index = {} if args.discover: test_index = discover_tests(args) with open(test_index_path, 'w') as f: f.write(json.dumps(test_index)) elif os.path.isfile(test_index_path): with open(test_index_path, 'r') as f: test_index = json.loads(''.join(f.readlines())) else: display('No test index found. Building test') test_index = discover_tests(args) with open(test_index_path, 'w') as f: f.write(json.dumps(test_index)) return test_index
def get_test_index(args): test_index_path = os.path.join(get_config_dir(), TEST_INDEX_FILE) test_index = {} if args.discover: test_index = discover_tests(args) with open(test_index_path, 'w') as f: f.write(json.dumps(test_index)) elif os.path.isfile(test_index_path): with open(test_index_path, 'r') as f: test_index = json.loads(''.join(f.readlines())) else: display('No test index found. Building test') test_index = discover_tests(args) with open(test_index_path, 'w') as f: f.write(json.dumps(test_index)) return test_index