Skip to content

Activate environment before debugging tests #4300

Closed
@mbunse

Description

@mbunse
  • VS Code version: 1.30.2
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.1, anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: numpy

Expected behaviour

Test runs in debug mode

Actual behaviour

When "Debug Test" is selected from within the editor above a unittest the known error message from #3330 is shown

Steps to reproduce:

  • install anaconda
  • create py3.6 and py3.7 environments
  • install vscode, python extension
  • open a folder of a python project using numpy with testing, enable testing, select the environment and click "Debug Test" above a test method of a test case from within the editor.

Logs

============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
benchmark: 3.2.2 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: c:\project, inifile:
plugins: cov-2.6.1, benchmark-3.2.2
=================================== ERRORS ====================================
__________________ ERROR collecting tests/test_data_prep.py ___________________
ImportError while importing test module 'c:\project\tests\test_data_prep.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\core\__init__.py:16: in <module>
    from . import multiarray
E   ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
During handling of the above exception, another exception occurred:
tests\test_data_prep.py:1: in <module>
    import numpy as np
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\__init__.py:142: in <module>
    from . import add_newdocs
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\add_newdocs.py:13: in <module>
    from numpy.lib import add_newdoc
C:\Users\XXXXX\AppData\Local\Continuum\anaconda3\envs\project\lib\site-packages\numpy\lib\__init__.py:8: in <module>
    from .type_check import ...
 generated xml file: C:\Users\XXXXX\AppData\Local\Temp\tmp-10040Ua1sUDOhID1o.xml 
=========================== 1 error in 0.27 seconds ===========================
ERROR: not found: c:\project\tests\test_data_prep.py::TestCustomFeautures::test_compare_name_email
(no name 'c:\\project\\tests\\test_data_prep.py::TestCustomFeautures::test_compare_name_email' in any of [<Module test_data_prep.py>])

Metadata

Metadata

Assignees

Labels

area-debuggingarea-environmentsFeatures relating to handling interpreter environmentsarea-testingbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions