Skip to content

exercism test does not respect active virtual environment Python #1191

@780Farva

Description

@780Farva

When running the exercism test command within a pyenv/pipenv virtual environment, the tool invokes python3 -m pytest but does not use the correct Python environment. This results in the error No module named pytest even though pytest is installed in the active environment.

Steps to Reproduce:

  1. Create and activate a pyenv/pipenv virtual environment.
  2. Install dependencies in the Pipfile (including pytest).
  3. Run exercism test to execute the tests for an exercise.

Expected Behavior:

exercism test should automatically use the active Python interpreter from the virtual environment and run the tests without issues, respecting the installed dependencies in that environment.

Actual Behavior:

The tool uses the Python interpreter from the global environment or pyenv's default path, causing it to not find the pytest module installed in the virtual environment.

Environment Details:

  • Operating System: Ubuntu via WSL2 on Windows
  • Python Version: 3.11.11 (via pyenv)
  • exercism Version: 3.5.4
  • pytest Version: 8.3.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions