Skip to content

Commit a873a8f

Browse files
authored
Stop testing old version and fix compatibility with pytest 5 (#80)
* Python3 supported versions: >= 3.5. * Python2 supported versions: 2.7 * pytest supported version: >= 3.6
1 parent fca00b6 commit a873a8f

File tree

5 files changed

+31
-37
lines changed

5 files changed

+31
-37
lines changed

.travis.yml

+10-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,19 @@
11
sudo: false
22
language: python
3-
python: "2.7"
3+
dist: xenial
4+
python:
5+
- "2.7"
6+
- "3.5"
7+
- "3.6"
8+
- "3.7"
49

5-
matrix:
6-
include:
7-
- env: TOXENV=py27-pytest33
8-
- env: TOXENV=py27-pytest34
9-
- env: TOXENV=py27-pytest35
10-
- env: TOXENV=py27-pytest36
11-
- env: TOXENV=py27-pytest37
12-
- env: TOXENV=py27-pytest38
13-
- env: TOXENV=py27-pytest39
14-
- env: TOXENV=py27-pytest310
15-
- env: TOXENV=py27-pytestlatest
16-
- env: TOXENV=py34-pytestlatest
17-
python: "3.4"
18-
- env: TOXENV=py35-pytestlatest
19-
python: "3.5"
20-
- env: TOXENV=py36-pytestlatest
21-
python: "3.6"
22-
- env: TOXENV=py37-pytestlatest
23-
python: "3.7"
24-
# Currently, python 3.7 is a little bit tricky to install:
25-
# https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905
26-
sudo: required
27-
dist: xenial
2810
install:
29-
- pip install tox
11+
- pip install tox tox-travis
3012
script: tox
3113
branches:
3214
except:
33-
- /^\d/
15+
- /^\d/
3416
notifications:
3517
email:
36-
37-
18+
19+

CHANGES.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
2.0.3
5+
-----
6+
7+
- Fix compatibility with pytest 5.
8+
9+
410
2.0.2
511
-----
612

pytest_factoryboy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""pytest-factoryboy public API."""
22
from .fixture import register, LazyFixture
33

4-
__version__ = '2.0.2'
4+
__version__ = '2.0.3'
55

66

77
__all__ = [

pytest_factoryboy/plugin.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ def pytest_runtest_call(item):
113113
def pytest_addhooks(pluginmanager):
114114
"""Register plugin hooks."""
115115
from pytest_factoryboy import hooks
116-
# addhooks is for older py.test and deprecated; replaced by add_hookspecs
117-
add_hookspecs = getattr(pluginmanager, 'add_hookspecs', pluginmanager.addhooks)
118-
add_hookspecs(hooks)
116+
pluginmanager.add_hookspecs(hooks)
119117

120118

121119
def pytest_generate_tests(metafunc):
@@ -124,4 +122,4 @@ def pytest_generate_tests(metafunc):
124122
fixturedef = arg2fixturedef[-1]
125123
related.extend(getattr(fixturedef.func, "_factoryboy_related", []))
126124

127-
metafunc.funcargnames.extend(related)
125+
metafunc.fixturenames.extend(related)

tox.ini

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
[tox]
22
distshare = {homedir}/.tox/distshare
3-
envlist = py27-pytest{33,34,35,36,37,38,39,310,latest},py{34,35,36,37}-pytestlatest
3+
envlist = py27-pytest{36,37,38,39,310,4,41,42,43,44,45,46},
4+
py37-pytest{36,37,38,39,310,4,41,42,43,44,45,46,5,latest},
5+
py{35,36}-pytestlatest
46

57
[testenv]
68
commands = pytest --junitxml={envlogdir}/junit-{envname}.xml {posargs:tests}
79
deps =
810
pytestlatest: pytest
11+
pytest5: pytest~=5.0.0
12+
pytest46: pytest~=4.6.0
13+
pytest45: pytest~=4.5.0
14+
pytest44: pytest~=4.4.0
15+
pytest43: pytest~=4.3.0
16+
pytest42: pytest~=4.2.0
17+
pytest41: pytest~=4.1.0
18+
pytest4: pytest~=4.0.0
919
pytest310: pytest~=3.10.0
1020
pytest39: pytest~=3.9.0
1121
pytest38: pytest~=3.8.0
1222
pytest37: pytest~=3.7.0
1323
pytest36: pytest~=3.6.0
14-
pytest35: pytest~=3.5.0
15-
pytest34: pytest~=3.4.0
16-
pytest33: pytest~=3.3.0
24+
1725
-r{toxinidir}/requirements-testing.txt
1826

1927
[pytest]

0 commit comments

Comments
 (0)