Skip to content

Unable to Execute Third-Party Unit Test Package with VSCode Debugger #349

@TeomanEgeSelcuk

Description

@TeomanEgeSelcuk

VS Code Version: 1.89.1
OS Version: 23H2 (Windows 11)

Steps to Reproduce:

  1. Create a new Python project in VSCode with a virtual environment (myenv) and install DeepEval using pip.
  2. Create a wrapper script (run_deepeval.py) to handle the DeepEval command.
  3. Configure the launch.json file with the following settings:
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Deepeval",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/langchain_env/run_deepeval.py",
            "args": [
                "test",
                "run",
                "${workspaceFolder}/tests/test_${fileBasename}"
            ],
            "debugStdLib": true,
            "justMyCode": true
        }
    ]
}
  1. Try to debug the project using the VSCode debugger.

Expected Behavior:
The VSCode debugger should execute the DeepEval package and run the unit tests successfully.

Actual Behavior:
The VSCode debugger throws an error:

C:\Users\myuser\anaconda3\envs\myenv\python.exe: No module named deepeval.__main__; 'deepeval' is a package and cannot be directly executed

Additional Information:

  • I have ensured that DeepEval is installed in the virtual environment (myenv).
  • I have verified that the Python interpreter is correctly set to the virtual environment in VSCode.
  • I have tried upgrading DeepEval to the latest version (0.21.45) using pip.

Question:
How can I configure VSCode to properly execute the DeepEval package within the debugger? Is there something wrong with my launch.json configuration, or is there a better way to set this up?

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from posterneeds spiketriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions