DefectDojo / django-DefectDojo

DevSecOps, ASPM, Vulnerability Management. All on one platform.
https://defectdojo.com
BSD 3-Clause "New" or "Revised" License
3.68k stars 1.55k forks source link

Unit tests won't run #11128

Open xpert98 opened 1 day ago

xpert98 commented 1 day ago

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

manuel-sommer commented 18 hours ago

I have the same problem. It was introduced in 2.38.0