diff --git a/.travis.yml b/.travis.yml index 9d15e1c..c40d721 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,19 @@ sudo: false language: python -python: "2.7" +dist: xenial +python: + - "2.7" + - "3.5" + - "3.6" + - "3.7" -matrix: - include: - - env: TOXENV=py27-pytest33 - - env: TOXENV=py27-pytest34 - - env: TOXENV=py27-pytest35 - - env: TOXENV=py27-pytest36 - - env: TOXENV=py27-pytest37 - - env: TOXENV=py27-pytest38 - - env: TOXENV=py27-pytest39 - - env: TOXENV=py27-pytest310 - - env: TOXENV=py27-pytestlatest - - env: TOXENV=py34-pytestlatest - python: "3.4" - - env: TOXENV=py35-pytestlatest - python: "3.5" - - env: TOXENV=py36-pytestlatest - python: "3.6" - - env: TOXENV=py37-pytestlatest - python: "3.7" - # Currently, python 3.7 is a little bit tricky to install: - # https://github.com/travis-ci/travis-ci/issues/9069#issuecomment-425720905 - sudo: required - dist: xenial install: -- pip install tox + - pip install tox tox-travis script: tox branches: except: - - /^\d/ + - /^\d/ notifications: email: - - bubenkoff@gmail.com - - oleg.pidsadnyi@gmail.com + - bubenkoff@gmail.com + - oleg.pidsadnyi@gmail.com diff --git a/CHANGES.rst b/CHANGES.rst index a408fc4..0645b25 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,12 @@ Changelog ========= +2.0.3 +----- + +- Fix compatibility with pytest 5. + + 2.0.2 ----- diff --git a/pytest_factoryboy/__init__.py b/pytest_factoryboy/__init__.py index c2ad41e..bea2cc3 100644 --- a/pytest_factoryboy/__init__.py +++ b/pytest_factoryboy/__init__.py @@ -1,7 +1,7 @@ """pytest-factoryboy public API.""" from .fixture import register, LazyFixture -__version__ = '2.0.2' +__version__ = '2.0.3' __all__ = [ diff --git a/pytest_factoryboy/plugin.py b/pytest_factoryboy/plugin.py index d70f2e3..fb143cc 100644 --- a/pytest_factoryboy/plugin.py +++ b/pytest_factoryboy/plugin.py @@ -113,9 +113,7 @@ def pytest_runtest_call(item): def pytest_addhooks(pluginmanager): """Register plugin hooks.""" from pytest_factoryboy import hooks - # addhooks is for older py.test and deprecated; replaced by add_hookspecs - add_hookspecs = getattr(pluginmanager, 'add_hookspecs', pluginmanager.addhooks) - add_hookspecs(hooks) + pluginmanager.add_hookspecs(hooks) def pytest_generate_tests(metafunc): @@ -124,4 +122,4 @@ def pytest_generate_tests(metafunc): fixturedef = arg2fixturedef[-1] related.extend(getattr(fixturedef.func, "_factoryboy_related", [])) - metafunc.funcargnames.extend(related) + metafunc.fixturenames.extend(related) diff --git a/tox.ini b/tox.ini index 50e423e..3f13bb6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,27 @@ [tox] distshare = {homedir}/.tox/distshare -envlist = py27-pytest{33,34,35,36,37,38,39,310,latest},py{34,35,36,37}-pytestlatest +envlist = py27-pytest{36,37,38,39,310,4,41,42,43,44,45,46}, + py37-pytest{36,37,38,39,310,4,41,42,43,44,45,46,5,latest}, + py{35,36}-pytestlatest [testenv] commands = pytest --junitxml={envlogdir}/junit-{envname}.xml {posargs:tests} deps = pytestlatest: pytest + pytest5: pytest~=5.0.0 + pytest46: pytest~=4.6.0 + pytest45: pytest~=4.5.0 + pytest44: pytest~=4.4.0 + pytest43: pytest~=4.3.0 + pytest42: pytest~=4.2.0 + pytest41: pytest~=4.1.0 + pytest4: pytest~=4.0.0 pytest310: pytest~=3.10.0 pytest39: pytest~=3.9.0 pytest38: pytest~=3.8.0 pytest37: pytest~=3.7.0 pytest36: pytest~=3.6.0 - pytest35: pytest~=3.5.0 - pytest34: pytest~=3.4.0 - pytest33: pytest~=3.3.0 + -r{toxinidir}/requirements-testing.txt [pytest]