Issues with pytest-testmon Running All Tests in a Large Project

I'm working on a large Python project with approximately 5000 tests and aiming to speed up my pre-merge test runs using pytest-testmon. My goal is to only run the tests affected by recent code changes. However, even after setting up pytest-testmon and upgrading to the latest version (2.1.1), I’m finding that it still runs all tests, even when there are no relevant changes.

Here’s what I’ve tried so far:

  1. Regenerating .testmondata: I removed .testmondata and ran pytest --testmon to rebuild the database, but the issue persists.

  2. Upgrading pytest-testmon: I updated to the latest version (2.1.1) to ensure compatibility with recent improvements.

  3. Using pytest-watch: I tried using pytest-watch with pytest --testmon, but it still selects all tests, even with no significant changes in the code between runs.

Question:

  1. Is it necessary to run all tests initially --testmon to populate the dependency database? Given the size of my project (5000 tests), a full run is very time-consuming, and I’m hoping to avoid it if possible.

Upvotes: 0

Views: 61

Answers (0)

Related Questions