pytest plugin and bowler codemod to help migrate tests to Python 3
Project description
pytest-mark-no-py3
This package provides a pytest plugin and a Bowler codemod to help migrate tests to Python 3.
Any tests marked with @pytest.mark.no_py3
will be expected to fail when
running on Python 3 and will fail the test if they pass unexpectedly.
Usage
Adding @pytest.mark.no_py3
-
Install this package in your test dependencies.
-
Run your tests on Python 3, savings the results with pytest's
--result-log
option, e.g.:tox -e py37 -- --result-log=test-results.txt
-
Install this package with the
bowler
extras in a Python 3 virtualenv:pip install pytest_mark_no_py3[bowler]
-
Apply the marker to all of the tests that failed on Python 3, running from the same directory that you ran the tests from:
python -m pytest_mark_no_py3.add --result-log=path/to/result-log.txt path/to/your/tests
If you're feeling confident, you can also use the
--no-interactive
option to apply the codemod without prompting to accept changes.
Removing @pytest.mark.no_py3
-
Fix some code so that tests start passing on Python 3, violating the xfail.
-
Run your tests on Python 3, savings the results with pytest's
--result-log
option, e.g.:tox -e py37 -- --result-log=test-results.txt
Warning: The only failing tests should be the tests that you fixed and want the marker removed from!
-
Install this package with the
bowler
extras in a Python 3 virtualenv:pip install pytest_mark_no_py3[bowler]
-
Remove the marker from all of the tests that "failed" (i.e. were expected to fail but actually passed) on Python 3, running from the same directory that you ran the tests from:
python -m pytest_mark_no_py3.remove --result-log=path/to/result-log.txt path/to/your/tests
If you're feeling confident, you can also use the
--no-interactive
option to apply the codemod without prompting to accept changes.
Running tests
Run tox
.
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
File details
Details for the file pytest-mark-no-py3-0.1.0.tar.gz
.
File metadata
- Download URL: pytest-mark-no-py3-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f32931c2316f5b8a1eda33c54f31e824da01ff3f733c3010e2b5e9190412402d |
|
MD5 | c1b472329526625c6f2eba909212b5c6 |
|
BLAKE2b-256 | c714a48c0a66ddd4abe441a0cd8f4768da21c3e309a5a2782b74873c33836580 |
File details
Details for the file pytest_mark_no_py3-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pytest_mark_no_py3-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd0a68bc478f04f99d9080d4459439389f11809f6f6a472647d161443b57e2fd |
|
MD5 | ece28d64cba7fdf9e053b4f37a0ee701 |
|
BLAKE2b-256 | 016ce44dd96db1d45c7b6511b0a097d707259798df536bae223c842a54545644 |