2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-18 10:46:31 +00:00

Unit test fixes (#10019)

* Add --keepdb option for unit test

* Reduce server launch overhead

- isGeneratingSchema was EXPENSIVE
- Running a single unit test reduced from 30s to 3s

* Option to disable check
This commit is contained in:
Oliver
2025-07-15 01:30:58 +10:00
committed by GitHub
parent ea00a50dfd
commit d62ac38cb1
5 changed files with 23 additions and 17 deletions

View File

@@ -47,6 +47,12 @@ def isRunningBackup():
def isGeneratingSchema():
"""Return true if schema generation is being executed."""
if isInServerThread() or isInWorkerThread():
return False
if isInTestMode():
return False
if 'schema' in sys.argv:
return True

View File

@@ -814,7 +814,7 @@ inventree_tags = {
}
# sentry.io integration for error reporting
SENTRY_ENABLED = get_boolean_setting(
SENTRY_ENABLED = not TESTING and get_boolean_setting(
'INVENTREE_SENTRY_ENABLED', 'sentry_enabled', False
)