- Notifications
You must be signed in to change notification settings - Fork16
Run the tests related to the changed files (according to Git) 🤓
License
anapaulagomes/pytest-picked
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Run the tests related to the unstaged files or the current branch(according to Git)
Let's say you have the following output fromgit status
:
$ git statusOn branch mainYour branch is ahead of 'origin/main' by 1 commit. (use "git push" to publish your local commits)Untracked files: (use "git add <file>..." to include in what will be committed) api.py tests/api/ tests/test_board.pynothing added to commit but untracked files present (use "git add" to track)
Runningpytest --picked
, the plugin will run all tests that come fromthis output.
$ pytest --picked============================= test session starts =============================platform darwin -- Python 3.6.4, pytest-3.6.0, py-1.5.3, pluggy-0.6.0rootdir: /Users/ana.gomes/personal-workspace/grandma, inifile:plugins: picked-0.1.0, mock-1.10.0, flask-0.10.0, deadfixtures-2.0.1collecting 34 itemsChanged test files... 1. ['tests/test_board.py']Changed test folders... 1. ['tests/api/']collected 34 itemstests/test_board.py . [ 50%]tests/api/test_new.py . [100%]=========================== 2 passed in 0.07 seconds ===========================
All tests will be run from files and folders which are modified but notyet committed. No more copy and paste!
pytest --pickedpytest --picked=firstpytest --picked --mode=branchpytest --picked --mode=unstaged# defaultpytest --picked --mode=branch --parent-branch=dev# if your parent branch differs from "main"
Usinggit status
, this plugin allows you to:
- Run only tests from modified test files
- Run tests from modified test files first, followed by all unmodified tests
You can installpytest-picked
viaPyPI:
pip install pytest-picked
Contributions are very welcome. Tests can be run withtox, so we can guarantee that it is workingin different python versions. Also, make sure to add tests and usepre-commit
before you submit a pull request.
Distributed under the terms of theMIT license,pytest-picked
is free and open source software
If you encounter any problems, pleasefile an issuealong with a detailed description.
About
Run the tests related to the changed files (according to Git) 🤓