-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
147 lines (107 loc) · 4.85 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# -*- coding: utf-8 -*-
from distutils.core import setup
packages = ["pytest_fastest"]
package_data = {"": ["*"]}
install_requires = ["pytest>=4.4"]
entry_points = {"pytest11": ["fastest = pytest_fastest"]}
setup_kwargs = {
"name": "pytest-fastest",
"version": "0.0.12",
"description": "Use SCM and coverage to run only needed tests",
"long_description": """\
==============
pytest-fastest
==============
.. image:: https://img.shields.io/pypi/v/pytest-fastest.svg
:target: https://pypi.org/project/pytest-fastest
:alt: PyPI version
.. image:: https://img.shields.io/pypi/pyversions/pytest-fastest.svg
:target: https://pypi.org/project/pytest-fastest
:alt: Python versions
.. image:: https://travis-ci.com/kstrauser/pytest-fastest.svg?branch=dev
:target: https://travis-ci.com/kstrauser/pytest-fastest
:alt: See Build Status on Travis CI
.. image:: https://ci.appveyor.com/api/projects/status/github/kstrauser/pytest-fastest?branch=dev
:target: https://ci.appveyor.com/project/kstrauser/pytest-fastest/branch/dev
:alt: See Build Status on AppVeyor
Use SCM and coverage to run only needed tests
----
This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s
`cookiecutter-pytest-plugin`_ template.
Features
--------
* Gathers coverage data from tests to track which tests call functions from which modules.
* Uses Git to track changes from a given commit to find the minimum set of tests that need to run
to test new changes, then skips everything else.
Requirements
------------
* Python 3.8+
* pytest 3.4.0+
Installation
------------
You can install "pytest-fastest" via `pip`_ from `PyPI`_::
$ pip install pytest-fastest
Usage
-----
pytest-fastest can be set to run only tests:
* That test modules that have changed in Git,
* Tests that we don't already have coverage data for, and
* Tests that we've added or changed.
In most common development workflows where you make short-lived branches
off a main "master" or "dev" branch, the amount of code that actually
changes while fixing a bug or writing a feature is usually just a small
portion of the whole codebase. Instead of running thousands of tests
after each change, pytest-fastest can identify the relevant ones that
thoroughly test your work but skip all the things you *haven't* changed.
To use it:
* In ``pytest.ini``, set ``fastest_commit`` to the name of a Git commit to
compare your current work against. (You can also set or override it on the
command line with ``--fastest-commit``). This is required if you want to
skip tests, which is the main reason for using this plugin.
* Use the command line argument ``--fastest-mode`` to choice the appropriate
running mode:
- ``all`` (default): Run all tests without collecting coverage data. This
emulates normal pytest behavior and has no effect on performance.
- ``skip``: Skip tests that don't need to be run, but update coverage data
on the ones that do run. This will usually be faster than ``all``, but
because collecting coverage information takes some time, as the number
of un-skippable tests grows very large it may actually become slower.
- ``gather``: Don't skip any tests, but do gather coverage data. This is
slower than ``all`` but can be used to seed the coverage cache.
- ``cache``: This is a fast mode for fixing existing tests. It skips tests
but doesn't update the coverage cache. It will never be slower than
``all`` and will always be faster than ``skip``.
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-fastest" is free and open source
software.
Issues
------
If you encounter any problems, please `file an issue`_ along with a detailed description.
.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`MIT`: http://opensource.org/licenses/MIT
.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause
.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt
.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`file an issue`: https://github.com/kstrauser/pytest-fastest/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
""",
"author": "Kirk Strauser",
"author_email": "[email protected]",
"url": "https://github.com/kstrauser/pytest-fastest",
"packages": packages,
"package_data": package_data,
"install_requires": install_requires,
"entry_points": entry_points,
"python_requires": ">=3.8,<4.0",
}
setup(**setup_kwargs)