question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Even if `tests-dir` is specified, pytest still collects tests on all the repository

See original GitHub issue

Long story short, I have a repository which is quite packed, including sub-directory that have their own tests sub-sub-directory.

When I run mutmut run --tests-dir tests/unit/, the first step still runs python -m pytest -x, which fails on my use case (because of the tests sub-sub-directories which should not be executed).

I would have expected mutmut to run python -m pytest -x tests/unit/ instead.

Is there a point to run pytest on the whole repository or is it an oversight?

(version 1.6.0)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
boxedcommented, Dec 2, 2019

Glad to hear it!

If you have social media followers or a blog spread the word! 😃

1reaction
SdgJlblcommented, Dec 2, 2019

That’s what I did, but I was wondering if it was the intended behaviour or if it is was a bug. Just letting you know in case of 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytest is running the testcases even I specify to collect only ...
When I run py.test --collect-only , the test case is run instead of just displaying the list of test cases to be run....
Read more >
BUG: pytest v3.10.0 collects and runs all tests twice ... - GitHub
Unfortunately, I can't provide the specific repo as my project is not open-source.
Read more >
Changing standard (Python) test discovery - Pytest
As the collector just works on directories, if you specify twice a single test file, pytest will still collect it twice, no matter...
Read more >
Testing Python Applications with Pytest
If we want to run tests defined as methods inside classes, ... will collect all test modules that were newly created or changed...
Read more >
Testing with pytest - Scikit-HEP
Python used to have three major choices for tests; but now pytest is used almost ... tests if it doesn't fail - you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found