Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Run the tests related to the changed files (according to Git) 🤓

License

NotificationsYou must be signed in to change notification settings

anapaulagomes/pytest-picked

Repository files navigation

See Test Status on Github Actions

PyPI version

Conda forge package

Supported Python versions

Run the tests related to the unstaged files or the current branch(according to Git)


Demo

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!

Usage

pytest --pickedpytest --picked=firstpytest --picked --mode=branchpytest --picked --mode=unstaged# defaultpytest --picked --mode=branch --parent-branch=dev# if your parent branch differs from "main"

Features

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

Installation

You can installpytest-picked viaPyPI:

pip install pytest-picked

Contributing

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-commitbefore you submit a pull request.

License

Distributed under the terms of theMIT license,pytest-picked is free and open source software

Issues

If you encounter any problems, pleasefile an issuealong with a detailed description.

About

Run the tests related to the changed files (according to Git) 🤓

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages


[8]ページ先頭

©2009-2025 Movatter.jp