1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] VSCode shows duplicate tests in Python

Discussão em 'Python' iniciado por Stack, Outubro 8, 2024.

  1. Stack

    Stack Membro Participativo

    I don't know if this due to a recent update, but I am seeing my Python tests appear twice and when I am in test debug mode it runs twice as well. How can I fix this? I just created an empty project and I am running into the same issue.

    Steps to reproduce:


    1. python -m venv .venv (create virtualenv)


    2. source ./.venv/bin/activate (activate virtualenv)


    3. pip install pytest==8.3.3


    4. On VSCode select Python interpreter to be the virtualenv one.


    5. mkdir server server/tests


    6. Basic tests file

      # server/tests/test_storage.py
      import pytest

      class TestStorage:
      def test(self):
      pass

    7. Settings.json (I tried different variations with the directory)

      {
      "python.testing.pytestArgs": [
      "tests"
      ],
      "python.testing.unittestEnabled": false,
      "python.testing.pytestEnabled": true
      }

    [​IMG] [​IMG]

    VSCode Version: 1.94.0 (Universal)

    Continue reading...

Compartilhe esta Página