Run the tests related to the changed files
Project description
Run the tests related to the unstaged files or the current branch (according to Git)
—
Let’s say you have the following output from git status:
$ git status On branch master Your branch is ahead of 'origin/master' 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.py nothing added to commit but untracked files present (use "git add" to track)
Running pytest --picked, the plugin will run all tests that come from this output.
$ pytest --picked ============================= test session starts ============================= platform darwin -- Python 3.6.4, pytest-3.6.0, py-1.5.3, pluggy-0.6.0 rootdir: /Users/ana.gomes/personal-workspace/grandma, inifile: plugins: picked-0.1.0, mock-1.10.0, flask-0.10.0, deadfixtures-2.0.1 collecting 34 items Changed test files... 1. ['tests/test_board.py'] Changed test folders... 1. ['tests/api/'] collected 34 items tests/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 not yet committed. No more copy and paste!
Usage
$ pytest --picked $ pytest --picked=first $ pytest --picked --mode=branch $ pytest --picked --mode=unstaged # default
Features
Using git 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
Installation
You can install pytest-picked via pip from PyPI:
$ pip install pytest-picked
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the MIT license, “pytest-picked” is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_picked-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e599c8fd4a39c6f9d3946cad10608562d4475ac6488e3b96ffcb8a605e26ff |
|
MD5 | f7ae4d3b84baae0d00b3d6d679a158e4 |
|
BLAKE2b-256 | a63f4b58860ecd65a4da2c388e4f8590f83b8be93173a4c423aca0dd90e0a67d |