From 4ff7453b482ca99a1481b096c96d9447fb2b4b93 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 10 Jan 2020 20:18:12 +0100 Subject: [PATCH 1/2] ci: Travis: Python 3.5.1 via Trusty Python 3.5.0 caused flaky failures before (https://github.com/pytest-dev/pytest/issues/5795). This is pulled out of https://github.com/pytest-dev/pytest/pull/6435, which adds code specific for Python < 3.5.2. It only runs a specific test, while collecting everything to get coverage of the version specific code around typing. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35ca8a69c9..5b67f15dd5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,8 +52,10 @@ jobs: - env: TOXENV=pypy3-xdist python: 'pypy3' - - env: TOXENV=py35-xdist - python: '3.5' + # Coverage for Python 3.5.{0,1} specific code, mostly typing related. + - env: TOXENV=py35 PYTEST_COVERAGE=1 PYTEST_ADDOPTS="-k test_raises_cyclic_reference" + python: '3.5.1' + dist: trusty # Specialized factors for py37. - env: TOXENV=py37-pluggymaster-xdist From f0c7f21312ca1445aefedcf25f2d54f2cdfe1924 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 12 Jan 2020 20:35:20 +0100 Subject: [PATCH 2/2] Remove "pragma: no cover" comments --- src/_pytest/compat.py | 2 +- testing/python/raises.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 8dd74b577a..de640bdd18 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -371,7 +371,7 @@ def getvalue(self) -> str: return self.buffer.getvalue().decode("UTF-8") -if sys.version_info < (3, 5, 2): # pragma: no cover +if sys.version_info < (3, 5, 2): def overload(f): # noqa: F811 return f diff --git a/testing/python/raises.py b/testing/python/raises.py index 1c701796af..cfdbe6748f 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -166,7 +166,7 @@ def __call__(self): # Early versions of Python 3.5 have some bug causing the # __call__ frame to still refer to t even after everything # is done. This makes the test pass for them. - if sys.version_info < (3, 5, 2): # pragma: no cover + if sys.version_info < (3, 5, 2): del self raise ValueError