Skip to content

Pytest run all tests, not singles #5757

@Simarra

Description

@Simarra

Environment data

  • VS Code version: 1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.2
  • OS and version: Ubuntu 18.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: --

Expected behaviour

Running a single test method should run it and not all method.

Actual behaviour

Running a test method run all the tests methods.

Alt Text

I have an idea of where the problem is: The item getted in my script seems not to be in the right order:

The dburlexpected param shuold be an URI and it is getted as the path of tests : 'tests/db_datapumping_urban_eco/test_db_preparator.py::test_tables_to_keep

If we run all the tests, it works perfectly fine.

moreover, if I run a single test with cli in a terminal , it works perfectly

Steps to reproduce:

  1. Install Python36, make a venv, call pytest with requests parameters.
  2. Config pytest in vcode to run with multiples arguments. (example: my config file)
  3. Run single tests or test file.

Config

settings.json (project)

{
    "python.pythonPath": "venv/bin/python3",
    "python.formatting.provider": "black",
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.enabled": true,
    "python.testing.pyTestArgs": [
        "tests/db_datapumping_urban_eco/",
        "--dburl",
        "postgresql://postgres:postgres@localhost:5432/dev_in",
        "--dburl-src",
        "postgresql://postgres:postgres@localhost:5432/dev_src",
        "--dburl-out",
        "postgresql://postgres:postgres@localhost:5432/dev_out"
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.pyTestEnabled": true
}

Logs

I refuse to pu logs for confidentiallity, but this part can be shown and is usefll

E           ValueError: The param 'dburl' must match with '^[\w+]+://(\w+)(?::(\w+))?@([^/:]+)(?::(\d+))?(?:/(\w*))?$', got 'tests/my_script/test_my_script_worker.py::test_generating_single_conn_if_same_dburl'

-------------- generated xml file: /tmp/tmp-18547QrRuTLLFZce9.xml --------------
===================== 10 passed, 6 error in 41.98 seconds ======================

Thanks for your help, testing is very important in development workflow!

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityregressionBug didn't exist in a previous release

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions