Changed unit tests so that they run with a simple pytest command

This commit is contained in:
ebolam 2022-06-10 08:39:15 -04:00
parent 1ea0df5295
commit 13f17d3eca
3 changed files with 5 additions and 4 deletions

View File

@ -937,10 +937,9 @@ def general_startup(override_args=None):
parser.add_argument("--lowmem", action='store_true', help="Extra Low Memory loading for the GPU, slower but memory does not peak to twice the usage") parser.add_argument("--lowmem", action='store_true', help="Extra Low Memory loading for the GPU, slower but memory does not peak to twice the usage")
parser.add_argument("--savemodel", action='store_true', help="Saves the model to the models folder even if --colab is used (Allows you to save models to Google Drive)") parser.add_argument("--savemodel", action='store_true', help="Saves the model to the models folder even if --colab is used (Allows you to save models to Google Drive)")
#args: argparse.Namespace = None #args: argparse.Namespace = None
if len(sys.argv) > 1 and override_args is None: if "pytest" in sys.modules and override_args is None:
if sys.argv[1] == 'unit_tests.py': args = parser.parse_args([])
args = parser.parse_args([]) return
return
if override_args is not None: if override_args is not None:
import shlex import shlex
args = parser.parse_args(shlex.split(override_args)) args = parser.parse_args(shlex.split(override_args))

2
pytest.ini Normal file
View File

@ -0,0 +1,2 @@
[pytest]
addopts = --ignore=miniconda3 --html=unit_test_report.html -v