• Stars
    star
    367
  • Rank 115,909 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

⚠️ Looking for maintainers

This project is not being actively maintained. Do you want to contribute to it and be a maintainer? Open an issue!


pytest-picked

See Test Status on Github Actions See Package Status on Test PyPI See Package Status on PyPI 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 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

$ pytest --picked --mode=branch --parent-branch=main # if your parent branch differs from "master"

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.

More Repositories

1

from-travis-to-github-actions

👨🏻‍🔧 ➡ 🤖
49
star
2

pardal

An accessible and customisable Twitter client
JavaScript
24
star
3

licitacoes-de-feira

Licitações de Feira de Santana de fácil acesso aos cidadãos 🏦
Python
18
star
4

looong

Discovery of Long Parameter List
Jupyter Notebook
16
star
5

step

The first step to automate things; from a Markdown to a CLI
Python
12
star
6

grandma

Another Slack bot to let you know when the coffee is done. ☕️👵🏼
Python
9
star
7

in-tests-we-trust

Exemplo de código para a palestra "In Tests We Trust: começando com TDD, mocks e mais"
Python
8
star
8

django-text-search

A proof of concept for different strategies on text searching with Django
Python
8
star
9

shut-up-and-give-me-the-data

Scripts de coleta dados de diversas fontes utilizando Python
Jupyter Notebook
7
star
10

onde-tem

Onde tem os seus produtos preferidos brasileiros em Berlim 🕵🏼‍♀️🥩
HTML
7
star
11

salarios-dos-servidores-de-feira

Salários dos servidores público de Feira de Santana 💰🏛
Jupyter Notebook
7
star
12

aprendendo-python

Um curso de Python para quem está programando pela primeira vez 🤓
Jupyter Notebook
6
star
13

tdd-workshop

Python
5
star
14

bazar-do-girassol

HTML
4
star
15

reviews-assigner

Assign Udacity's revision automatically! 🔦
Python
4
star
16

pardal-python

[experimental project] An accessible and customisable Twitter client
Python
4
star
17

fcsv

Write a CSV using C through a Python module
C
4
star
18

saul

Analyze git logs and suggest areas of improvement according to your Git log
Python
3
star
19

criando-produtos-digitais

Uma lista de ferramentas brasileiras para começar produtos digitais 🇧🇷📦
3
star
20

falabaiana

Gerador de expressões pessoal
Go
3
star
21

teia

Cria um grafo a partir de uma rede de pessoas e instituições 🕸🔍💰
Python
2
star
22

meetups-analysis

Análise dos meetups de tecnologia mais ativos em Belo Horizonte.
Python
2
star
23

radio

Old but new 📻
Python
2
star
24

pass2dashlane

Moving from Pass to Dashlane 🔒
Python
1
star
25

passando-recibo

Projeto da Imersão de AI da Alura - explorando o Google Gemini 🛒🧾
Jupyter Notebook
1
star
26

go-tunefy

Save your favorite soundtracks on Spotify 🎧 🚧 WORK IN PROGRESS 🚧
Go
1
star
27

drs_bot

How did you know about this course? Well, a little bot told me... 🤖
Python
1
star