pytest-picked


Namepytest-picked JSON
Version 0.5.1 PyPI version JSON
download
home_pageNone
SummaryRun the tests related to the changed files
upload_time2024-11-06 23:19:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords pytest testing changed files selective tests
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pytest-picked

[![See Test Status on Github Actions](https://github.com/anapaulagomes/pytest-picked/workflows/Tests/badge.svg)](https://github.com/anapaulagomes/pytest-picked/actions?query=workflow%3ATests)

[![PyPI version](https://badge.fury.io/py/pytest-picked.svg)](https://badge.fury.io/py/pytest-picked)

[![Conda forge package](https://img.shields.io/conda/vn/conda-forge/pytest-picked.svg)](https://anaconda.org/conda-forge/pytest-picked)

[![Supported Python versions](https://img.shields.io/pypi/pyversions/pytest-picked.svg)](https://pypi.org/project/pytest-picked)

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

---

![Demo](demo.gif)

Let's say you have the following output from `git status`:

    $ git status

    On branch main
    Your 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.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

```bash
pytest --picked

pytest --picked=first

pytest --picked --mode=branch

pytest --picked --mode=unstaged  # default

pytest --picked --mode=branch --parent-branch=dev # if your parent branch differs from "main"
```

## 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 [PyPI](https://pypi.org/project/pytest-picked/):

```bash
pip install pytest-picked
```

## Contributing

Contributions are very welcome. Tests can be run with
[tox](https://tox.readthedocs.io/en/latest/), so we can guarantee that it is working
in different python versions. Also, make sure to add tests and use `pre-commit`
before you submit a pull request.

## License

Distributed under the terms of the [MIT](http://opensource.org/licenses/MIT) license,
`pytest-picked` is free and open source software

## Issues

If you encounter any problems, please [file an issue](https://github.com/anapaulagomes/pytest-picked/issues)
along with a detailed description.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pytest-picked",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "pytest, testing, changed files, selective tests",
    "author": null,
    "author_email": "Ana Paula Gomes <apgomes88@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ba/e4/51a54dd6638fd4a7c45bb20a737235fd92cbb4d24b5ff681d64ace5d02e9/pytest_picked-0.5.1.tar.gz",
    "platform": null,
    "description": "# pytest-picked\n\n[![See Test Status on Github Actions](https://github.com/anapaulagomes/pytest-picked/workflows/Tests/badge.svg)](https://github.com/anapaulagomes/pytest-picked/actions?query=workflow%3ATests)\n\n[![PyPI version](https://badge.fury.io/py/pytest-picked.svg)](https://badge.fury.io/py/pytest-picked)\n\n[![Conda forge package](https://img.shields.io/conda/vn/conda-forge/pytest-picked.svg)](https://anaconda.org/conda-forge/pytest-picked)\n\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/pytest-picked.svg)](https://pypi.org/project/pytest-picked)\n\nRun the tests related to the unstaged files or the current branch\n(according to Git)\n\n---\n\n![Demo](demo.gif)\n\nLet's say you have the following output from `git status`:\n\n    $ git status\n\n    On branch main\n    Your branch is ahead of 'origin/main' by 1 commit.\n      (use \"git push\" to publish your local commits)\n\n    Untracked files:\n      (use \"git add <file>...\" to include in what will be committed)\n\n      api.py\n      tests/api/\n      tests/test_board.py\n\n    nothing added to commit but untracked files present (use \"git add\" to track)\n\nRunning `pytest --picked`, the plugin will run all tests that come from\nthis output.\n\n    $ pytest --picked\n\n    ============================= test session starts =============================\n    platform darwin -- Python 3.6.4, pytest-3.6.0, py-1.5.3, pluggy-0.6.0\n    rootdir: /Users/ana.gomes/personal-workspace/grandma, inifile:\n    plugins: picked-0.1.0, mock-1.10.0, flask-0.10.0, deadfixtures-2.0.1\n    collecting 34 items\n    Changed test files... 1. ['tests/test_board.py']\n    Changed test folders... 1. ['tests/api/']\n    collected 34 items\n\n    tests/test_board.py .                                                      [ 50%]\n    tests/api/test_new.py .                                                    [100%]\n\n    =========================== 2 passed in 0.07 seconds ===========================\n\nAll tests will be run from files and folders which are modified but not\nyet committed. No more copy and paste!\n\n## Usage\n\n```bash\npytest --picked\n\npytest --picked=first\n\npytest --picked --mode=branch\n\npytest --picked --mode=unstaged  # default\n\npytest --picked --mode=branch --parent-branch=dev # if your parent branch differs from \"main\"\n```\n\n## Features\n\nUsing `git status`, this plugin allows you to:\n\n- Run only tests from modified test files\n- Run tests from modified test files first, followed by all unmodified tests\n\n## Installation\n\nYou can install `pytest-picked` via [PyPI](https://pypi.org/project/pytest-picked/):\n\n```bash\npip install pytest-picked\n```\n\n## Contributing\n\nContributions are very welcome. Tests can be run with\n[tox](https://tox.readthedocs.io/en/latest/), so we can guarantee that it is working\nin different python versions. Also, make sure to add tests and use `pre-commit`\nbefore you submit a pull request.\n\n## License\n\nDistributed under the terms of the [MIT](http://opensource.org/licenses/MIT) license,\n`pytest-picked` is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/anapaulagomes/pytest-picked/issues)\nalong with a detailed description.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Run the tests related to the changed files",
    "version": "0.5.1",
    "project_urls": null,
    "split_keywords": [
        "pytest",
        " testing",
        " changed files",
        " selective tests"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c681450c017746caab376c4b6700439de9f1cc7d8e1f22dec3c1eb235cd9ad3e",
                "md5": "365f45542ba2a09f535b953185468153",
                "sha256": "af65c4763b51dc095ae4bc5073a962406902422ad9629c26d8b01122b677d998"
            },
            "downloads": -1,
            "filename": "pytest_picked-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "365f45542ba2a09f535b953185468153",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6608,
            "upload_time": "2024-11-06T23:19:51",
            "upload_time_iso_8601": "2024-11-06T23:19:51.284225Z",
            "url": "https://files.pythonhosted.org/packages/c6/81/450c017746caab376c4b6700439de9f1cc7d8e1f22dec3c1eb235cd9ad3e/pytest_picked-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bae451a54dd6638fd4a7c45bb20a737235fd92cbb4d24b5ff681d64ace5d02e9",
                "md5": "225b5fb5af38ef9eadbb79be5064a0aa",
                "sha256": "6634c4356a560a5dc3dba35471865e6eb06bbd356b56b69c540593e9d5620ded"
            },
            "downloads": -1,
            "filename": "pytest_picked-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "225b5fb5af38ef9eadbb79be5064a0aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 8401,
            "upload_time": "2024-11-06T23:19:52",
            "upload_time_iso_8601": "2024-11-06T23:19:52.538724Z",
            "url": "https://files.pythonhosted.org/packages/ba/e4/51a54dd6638fd4a7c45bb20a737235fd92cbb4d24b5ff681d64ace5d02e9/pytest_picked-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-06 23:19:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pytest-picked"
}
        
Elapsed time: 0.84691s