Skip to content

Commit 6de05fa

Browse files
committed
register marks, document python and pytest dependencies, and test the full matrix with tox and travis
1 parent d3e5615 commit 6de05fa

File tree

7 files changed

+54
-20
lines changed

7 files changed

+54
-20
lines changed

.travis.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
dist: xenial
12
language: python
2-
python: "3.5"
3-
env:
4-
- TOX_ENV=py35
5-
- TOX_ENV=py34
6-
- TOX_ENV=py33
7-
- TOX_ENV=py27
8-
- TOX_ENV=py26
3+
python:
4+
- "2.7"
5+
- "3.4"
6+
- "3.5"
7+
- "3.6"
8+
- "3.7"
9+
- "pypy"
910
install:
1011
- pip install tox
1112
- pip install python-coveralls
1213
script:
13-
- tox -e $TOX_ENV
14+
- TOX_PYTHON_VERSION=$(if [ $TRAVIS_PYTHON_VERSION = "pypy" ]; then echo "pypy"; else echo py$TRAVIS_PYTHON_VERSION | tr -d .; fi)
15+
- tox -e $(tox -l | grep $TOX_PYTHON_VERSION | paste -sd "," -)
1416
after_success:
15-
coveralls
17+
- coveralls
1618
sudo: false

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Frank Tobia <[email protected]>
22
Sergei Chipiga <[email protected]>
33
Ben Greene <[email protected]>
44
Adam Talsma <[email protected]>
5+
Brian Maissy <[email protected]>

docs/source/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ second-to-last) or relative (i.e. run this test before this other test).
1616
you read here isn't currently implemented, rest assured that I am working
1717
on it (or feel free to ping me: https://github.com/ftobia)
1818
19+
Supported python and pytest versions
20+
------------------------------------
21+
22+
pytest-ordering supports python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy, and is
23+
compatible with pytest 3.6.0 or newer.
24+
1925

2026
Quickstart
2127
----------

pytest_ordering/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,23 @@
2828
def pytest_configure(config):
2929
"""Register the "run" marker."""
3030

31+
provided_by_pytest_ordering = (
32+
'Provided by pytest-ordering. '
33+
'See also: http://pytest-ordering.readthedocs.org/'
34+
)
35+
3136
config_line = (
3237
'run: specify ordering information for when tests should run '
33-
'in relation to one another. Provided by pytest-ordering. '
34-
'See also: http://pytest-ordering.readthedocs.org/'
38+
'in relation to one another. ' + provided_by_pytest_ordering
3539
)
3640
config.addinivalue_line('markers', config_line)
3741

42+
for mark_name in orders_map.keys():
43+
config_line = '{}: run test {}. {}'.format(mark_name,
44+
mark_name.replace('_', ' '),
45+
provided_by_pytest_ordering)
46+
config.addinivalue_line('markers', config_line)
47+
3848

3949
def pytest_collection_modifyitems(session, config, items):
4050
grouped_items = {}

setup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'pytest_ordering = pytest_ordering',
2525
]
2626
},
27-
install_requires=['pytest'],
27+
install_requires=['pytest>=3.6'],
2828
classifiers=[
2929
'Development Status :: 4 - Beta',
3030
'Intended Audience :: Developers',
@@ -37,11 +37,12 @@
3737
'Topic :: Utilities',
3838
'Programming Language :: Python',
3939
'Programming Language :: Python :: 2',
40-
'Programming Language :: Python :: 2.6',
4140
'Programming Language :: Python :: 2.7',
4241
'Programming Language :: Python :: 3',
43-
'Programming Language :: Python :: 3.2',
44-
'Programming Language :: Python :: 3.3',
42+
'Programming Language :: Python :: 3.4',
43+
'Programming Language :: Python :: 3.5',
44+
'Programming Language :: Python :: 3.6',
45+
'Programming Language :: Python :: 3.7',
4546
'Programming Language :: Python :: Implementation :: PyPy',
4647
],
4748
)

tests/test_ordering.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,10 @@ def test_5(self): pass
268268
assert item_names_for(tests_content) == ['test_3', 'test_4', 'test_5', 'test_1', 'test_2']
269269

270270

271-
def test_run_marker_registered(capsys):
272-
pytest.main('--markers')
271+
def test_markers_registered(capsys):
272+
pytest.main(['--markers'])
273273
out, err = capsys.readouterr()
274274
assert '@pytest.mark.run' in out
275+
assert '@pytest.mark.first' in out
276+
assert '@pytest.mark.last' in out
277+
assert out.count('Provided by pytest-ordering') == 17

tox.ini

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# content of: tox.ini, put in same dir as setup.py
22
[tox]
3-
envlist = py26,py27,py33,py34,py35,pypy
3+
envlist = {py27,py34,py35,py36,py37,pypy}-pytest{36,37,38,39,310,40,41,42,43,44,45}
44
[testenv]
5-
deps=pytest
5+
deps =
6+
pytest36: pytest>=3.6,<3.7
7+
pytest37: pytest>=3.7,<3.8
8+
pytest38: pytest>=3.8,<3.9
9+
pytest39: pytest>=3.9,<3.10
10+
pytest310: pytest>=3.10,<3.11
11+
pytest40: pytest>=4.0,<4.1
12+
pytest41: pytest>=4.1,<4.2
13+
pytest42: pytest>=4.2,<4.3
14+
pytest43: pytest>=4.3,<4.4
15+
pytest44: pytest>=4.4,<4.5
16+
pytest45: pytest>=4.5,<4.6
617
pytest-cov
7-
commands=
18+
commands =
819
coverage run --source=pytest_ordering -m py.test tests
920
coverage report -m --fail-under=95

0 commit comments

Comments
 (0)