You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running tests with the --pdb flag for tests in a directory that are relative imports are not working. For example if the tests are not included in the source of the project under test (ie a separate top level test/ directory). For example:
{0} unittest.loader._FailedTest.python [0.000093s] ... FAILED
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
ImportError: Failed to import test module: python
Traceback (most recent call last):
File "/usr/lib64/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
ModuleNotFoundError: No module named 'test.python'
==============================
Failed 1 tests - output below:
==============================
unittest.loader._FailedTest.python
----------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
ImportError: Failed to import test module: python
Traceback (most recent call last):
File "/usr/lib64/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
ModuleNotFoundError: No module named 'test.python'
No discover, which uses a subprocess works fine. My guess is that the python interpreter doesn't have the test/ in it's pythonpath for whatever reason and can't find the module from the test id, but the source of the issue is not clear.
Expected behavior and actual behavior
The test case is run in the same process (ie pdb mode) instead of erroring.
Issue description
When running tests with the --pdb flag for tests in a directory that are relative imports are not working. For example if the tests are not included in the source of the project under test (ie a separate top level test/ directory). For example:
No discover, which uses a subprocess works fine. My guess is that the python interpreter doesn't have the test/ in it's pythonpath for whatever reason and can't find the module from the test id, but the source of the issue is not clear.
Expected behavior and actual behavior
The test case is run in the same process (ie pdb mode) instead of erroring.
Steps to reproduce the problem
Try to run any test case from https://github.com/Qiskit/qiskit-terra with the
--pdb
flagSpecifications like the version of the project, operating system, or hardware
System information
stestr --version
): 2.6.0 (and master)python --version
): 3.7pip freeze
): N/AAdditional information
The text was updated successfully, but these errors were encountered: