disable some checks if testing
This commit is contained in:
parent
d302596d73
commit
c8bf2c2071
2 changed files with 7 additions and 3 deletions
|
@ -78,8 +78,11 @@ class DateTimeAction(Action):
|
||||||
code_dir = os.path.dirname(os.path.realpath(__file__))
|
code_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
|
||||||
def common_pre():
|
def common_pre(nochecks=False):
|
||||||
prechecks = [pre_check_user, pre_check_permissions, pre_check_ffmpeg]
|
if nochecks:
|
||||||
|
prechecks = []
|
||||||
|
else:
|
||||||
|
prechecks = [pre_check_user, pre_check_permissions, pre_check_ffmpeg]
|
||||||
configs = ["default_config.py"]
|
configs = ["default_config.py"]
|
||||||
if "TECHREC_CONFIG" in os.environ:
|
if "TECHREC_CONFIG" in os.environ:
|
||||||
for conf in os.environ["TECHREC_CONFIG"].split(":"):
|
for conf in os.environ["TECHREC_CONFIG"].split(":"):
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sys
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
import os
|
import os
|
||||||
|
@ -20,7 +21,7 @@ from .forge import create_mp3, Validator
|
||||||
|
|
||||||
logger = logging.getLogger("server")
|
logger = logging.getLogger("server")
|
||||||
|
|
||||||
common_pre()
|
common_pre(nochecks=('pytest' in sys.argv[0]))
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
db = None
|
db = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue