disable some checks if testing

This commit is contained in:
boyska 2021-09-29 00:31:08 +02:00
parent d302596d73
commit c8bf2c2071
2 changed files with 7 additions and 3 deletions

View file

@ -78,8 +78,11 @@ class DateTimeAction(Action):
code_dir = os.path.dirname(os.path.realpath(__file__))
def common_pre():
prechecks = [pre_check_user, pre_check_permissions, pre_check_ffmpeg]
def common_pre(nochecks=False):
if nochecks:
prechecks = []
else:
prechecks = [pre_check_user, pre_check_permissions, pre_check_ffmpeg]
configs = ["default_config.py"]
if "TECHREC_CONFIG" in os.environ:
for conf in os.environ["TECHREC_CONFIG"].split(":"):

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
import logging
import time
import os
@ -20,7 +21,7 @@ from .forge import create_mp3, Validator
logger = logging.getLogger("server")
common_pre()
common_pre(nochecks=('pytest' in sys.argv[0]))
app = FastAPI()
db = None