Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
v = MiscData.get(key='version')
if v is None:
existing_db_version = 1
else:
existing_db_version = int(v.value)
except (RowNotFound, ERDiagramError, OperationalError):
existing_db_version = 1
if existing_db_version != current_db_version:
print('mutmut cache is out of date, clearing it...')
db.drop_all_tables(with_all_data=True)
db.schema = None # Pony otherwise thinks we've already created the tables
db.generate_mapping(create_tables=True)
with db_session:
v = get_or_create(MiscData, key='version')
v.value = str(current_db_version)
return f(*args, **kwargs)
return wrapper
def set_cached_test_time(baseline_time_elapsed, current_hash_of_tests):
get_or_create(MiscData, key='baseline_time_elapsed').value = str(baseline_time_elapsed)
get_or_create(MiscData, key='hash_of_tests').value = current_hash_of_tests
def set_cached_test_time(baseline_time_elapsed, current_hash_of_tests):
get_or_create(MiscData, key='baseline_time_elapsed').value = str(baseline_time_elapsed)
get_or_create(MiscData, key='hash_of_tests').value = current_hash_of_tests