Skip to content

Commit

Permalink
Test with current pytest and Python version. (#70)
Browse files Browse the repository at this point in the history
* Drop support for pytest versions < 3.6 to reduce the maintenance burden.
* Keeping support for the newest 5 pytest releases.
* Fix tests for 3.9 and 3.10
  • Loading branch information
sallner authored and Michael Howitz committed Nov 6, 2018
1 parent 1ad001b commit 40bdecb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
19 changes: 8 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
language: python
dist: xenial
sudo: true
python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
- 3.7-dev
- pypy
- pypy3.5-5.8.0
- pypy2.7-5.10.0
- pypy3.5
env:
- PYTEST=2.8.7
- PYTEST=2.9.2
- PYTEST=3.0.7
- PYTEST=3.1.3
- PYTEST=3.2.1
- PYTEST=3.3.2
- PYTEST=3.4.2
- PYTEST=3.5.1
- PYTEST=3.6.3
- PYTEST=3.6.4
- PYTEST=3.7.4
- PYTEST=3.8.2
- PYTEST=3.9.3
- PYTEST=3.10.0
install:
- pip install -q pytest==$PYTEST
- pip install -q -e .
Expand Down
10 changes: 7 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Changelog
---------


4.3 (unreleased)
5.0 (unreleased)
================

- Nothing changed yet.
- Drop support for pytest versions < 3.6 to reduce the maintenance burden.

- Add support up to pytest version 3.10. Thus supporting the newest 5 pytest
releases.

- Add support for Python 3.7.


4.2 (2018-10-04)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup

setup(name='pytest-rerunfailures',
version='4.3.dev0',
version='5.0.dev0',
description='pytest plugin to re-run tests to eliminate flaky failures',
long_description=(
open('README.rst').read() +
Expand All @@ -12,7 +12,7 @@
url='https://github.com/pytest-dev/pytest-rerunfailures',
py_modules=['pytest_rerunfailures'],
entry_points={'pytest11': ['rerunfailures = pytest_rerunfailures']},
install_requires=['pytest >= 2.8.7'],
install_requires=['pytest >= 3.6'],
license='Mozilla Public License 2.0 (MPL 2.0)',
keywords='py.test pytest rerun failures flaky',
classifiers=[
Expand Down
19 changes: 10 additions & 9 deletions test_pytest_rerunfailures.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import random
import time
import pytest_rerunfailures

try:
import mock
except ImportError:
from unittest import mock
except ImportError:
import mock

import pytest

pytest_plugins = 'pytester'


def temporary_failure(count=1):
return """import py
path = py.path.local(__file__).dirpath().ensure('test.res')
count = path.read() or 1
if int(count) <= {0}:
path.write(int(count) + 1)
raise Exception('Failure: {{0}}'.format(count))""".format(count)
return """
import py
path = py.path.local(__file__).dirpath().ensure('test.res')
count = path.read() or 1
if int(count) <= {0}:
path.write(int(count) + 1)
raise Exception('Failure: {{0}}'.format(count))""".format(
count)


def assert_outcomes(result, passed=1, skipped=0, failed=0, error=0, xfailed=0,
Expand Down
12 changes: 3 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
# and then run "tox" from this directory.

[tox]
envlist = py{27,34,35,36,37,py,py3}-pytest{27,28,29,30,31,32,33,34,35,36,37,38},
envlist = py{27,34,35,36,37,py,py3}-pytest{36,37,38,39,310},

[testenv]
commands = py.test test_pytest_rerunfailures.py {posargs}
deps =
mock
pytest28: pytest==2.8.*
pytest29: pytest==2.9.*
pytest30: pytest==3.0.*
pytest31: pytest==3.1.*
pytest32: pytest==3.2.*
pytest33: pytest==3.3.*
pytest34: pytest==3.4.*
pytest35: pytest==3.5.*
pytest36: pytest==3.6.*
pytest37: pytest==3.7.*
pytest38: pytest==3.8.*
pytest39: pytest==3.9.*
pytest310: pytest==3.10.*

0 comments on commit 40bdecb

Please sign in to comment.