Accepting request 863329 from home:mcalabkova:branches:devel:languages:python:pytest

- Add pytest62.patch to make testsuite compatible with new pytest

OBS-URL: https://build.opensuse.org/request/show/863329
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-cov?expand=0&rev=22
This commit is contained in:
2021-01-15 12:17:00 +00:00
committed by Git OBS Bridge
parent 4f77fecc65
commit e8988c1b79
3 changed files with 40 additions and 1 deletions

31
pytest62.patch Normal file
View File

@@ -0,0 +1,31 @@
From 25eed212085ce9a2d5383a6a4a2b360d0d514f89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= <contact@ionelmc.ro>
Date: Mon, 11 Jan 2021 15:49:18 +0200
Subject: [PATCH] Turns out there were some internal changes in the pytester
plugin.
---
tests/test_pytest_cov.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py
index f0fd6ca..c6511aa 100644
--- a/tests/test_pytest_cov.py
+++ b/tests/test_pytest_cov.py
@@ -1538,8 +1538,14 @@ def test_cover_looponfail(testdir, monkeypatch):
testdir.makeconftest(CONFTEST)
script = testdir.makepyfile(BASIC_TEST)
- monkeypatch.setattr(testdir, 'run',
- lambda *args, **kwargs: _TestProcess(*map(str, args)))
+ def mock_run(*args, **kwargs):
+ return _TestProcess(*map(str, args))
+
+ monkeypatch.setattr(testdir, 'run', mock_run)
+ assert testdir.run is mock_run
+ if hasattr(testdir, '_pytester'):
+ monkeypatch.setattr(testdir._pytester, 'run', mock_run)
+ assert testdir._pytester.run is mock_run
with testdir.runpytest('-v',
'--cov=%s' % script.dirpath(),
'--looponfail',