anapaulagomes/pytest-picked

Add option to run the changed files from the current branch

Closed this issue · 4 comments

Let's say you are working on a feature branch and would like to run all the tests that were changed when compared with the master. To check it, you can run: git diff --name-only master.

Would be nice to have this option on picked. I'm wondering if something like pytest --picked=branch would be the best way to go.

I believe this would help make the plugin usable for @coala. We want to run only effected tests in CI. That means it needs to look at the branch, or the commit, not at staged/uncommitted changes.

When I do a commit of a test atm, it shows nothing
https://travis-ci.org/jayvdb/coala/jobs/394415995

fwiw https://github.com/kstrauser/pytest-fastest allows specifying a commit to base the differences on, but unfortunately it is incompatible with pytest-cov kstrauser/pytest-fastest#4

I didn't know about this project. Cool! Hoping to make it usable for your project soon.

@jayvdb I've pushed a draft of this feature (#13). Feel free to take a look and try it out!

#13 merged.