ImportError: Failed to import test module: unittests
Traceback (most recent call last):
File "/usr/local/lib/python3.11/unittest/loader.py", line 162, in loadTestsFromName
module = import(module_name)
^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'unittests'
Steps to reproduce
Steps to reproduce the behavior:
The same error occurs when using both of these commands
./dc-unittest.sh --test-case unittests.tools.test__parser.TestParser
docker compose exec uwsgi bash -c 'python manage.py test unittests.tools._parser.TestParser'
This goes for the parser I've written as well as existing unmodified parsers.
Expected behavior
Expected behavior is for the unit test to run.
Deployment method(select with an X)
[X] Docker Compose
[ ] Kubernetes
[ ] GoDojo
Environment information
Operating System: Ubuntu 22.04
DefectDojo version (see footer) or commit message: 2.39.1
Problem description Attempting to run a unit test for any parser results in the following error:
====================================================================== ERROR: unittests (unittest.loader._FailedTest.unittests)
ImportError: Failed to import test module: unittests Traceback (most recent call last): File "/usr/local/lib/python3.11/unittest/loader.py", line 162, in loadTestsFromName module = import(module_name) ^^^^^^^^^^^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'unittests'
Steps to reproduce Steps to reproduce the behavior: The same error occurs when using both of these commands ./dc-unittest.sh --test-case unittests.tools.test__parser.TestParser
docker compose exec uwsgi bash -c 'python manage.py test unittests.tools._parser.TestParser'
This goes for the parser I've written as well as existing unmodified parsers.
Expected behavior Expected behavior is for the unit test to run.
Deployment method (select with an
X
)Environment information