Skip to content

Commit

Permalink
Stop testing old version and fix compatibility with pytest 5 (#80)
Browse files Browse the repository at this point in the history
* Python3 supported versions: >= 3.5.
* Python2 supported versions: 2.7
* pytest supported version: >= 3.6
  • Loading branch information
youtux authored Jul 3, 2019
1 parent fca00b6 commit a873a8f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
38 changes: 10 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

2.0.3
-----

- Fix compatibility with pytest 5.


2.0.2
-----

Expand Down
2 changes: 1 addition & 1 deletion pytest_factoryboy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""pytest-factoryboy public API."""
from .fixture import register, LazyFixture

__version__ = '2.0.2'
__version__ = '2.0.3'


__all__ = [
Expand Down
6 changes: 2 additions & 4 deletions pytest_factoryboy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
16 changes: 12 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit a873a8f

Please sign in to comment.