Skip to content

Does not recognize the results of the second test module. #465

@fargoss

Description

@fargoss

Describe the bug
Does not recognize the results of the second test module.

To Reproduce

Directory structure:

myproject/
├── foobar1/
│   ├── module1.py
│   └── module2.py
├── foobar2/
│   ├── module3.py
│   └── module4.py
└── tests/
    ├── test_module1.py
    └── test_module2.py
    └── test_module3.py
    └── test_module4.py

The following command is used to generate coverage:

pytest tests --cov-report xml:cov.xml --cov foobar1 --cov foobar2

This generates the cov.xml file with the following content:

...
<sources>
	<source>/Users/username/projects/myproject/foobar1</source>
	<source>/Users/username/projects/myproject/foobar2</source>
</sources>
...

In VSCode, modules from foobar1 are highlighted correctly, but modules from foobar2 show "No Coverage."
If the first module is commented out in cov.xml:

<sources>
	<!-- <source>/Users/username/projects/myproject/foobar1</source> -->
	<source>/Users/username/projects/myproject/foobar2</source>
</sources>

Or if the order of the modules is swapped:

<sources>
	<source>/Users/username/projects/myproject/foobar2</source>
	<source>/Users/username/projects/myproject/foobar1</source>
</sources>

Then the coverage results switch—modules from foobar2 are correctly displayed, while modules from foobar1 are not.

Expected behaviour
It is expected that after the tests are run, all modules will be highlighted correctly.

Desktop:

  • OS: MacOs
  • Extension Version 2.12.0
  • VSCode Version 1.96.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions