Tests - parallelize python tests w/ pytest-xdist

This commit is contained in:
Sam
2022-11-19 20:17:58 +01:00
parent df7532a633
commit 872105e2d3
11 changed files with 105 additions and 11 deletions

View File

@ -18,7 +18,11 @@ def get_app_config(
max_users: Optional[int] = None,
) -> Optional[AppConfig]:
if with_config:
config = AppConfig()
config = AppConfig.query.one_or_none()
if not config:
config = AppConfig()
db.session.add(config)
db.session.flush()
config.gpx_limit_import = 10 if max_workouts is None else max_workouts
config.max_single_file_size = (
(1 if max_single_file_size is None else max_single_file_size)
@ -31,7 +35,6 @@ def get_app_config(
* 1024
)
config.max_users = 100 if max_users is None else max_users
db.session.add(config)
db.session.commit()
return config
return None