summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-12-15 11:56:24 +0100
committerMichał Górny <mgorny@gentoo.org>2020-12-15 12:05:41 +0100
commit40d346e878a71971c84c7ee0cc1024f05e2823ac (patch)
tree7a98e7f0b3235ad061d8ad1cf58cc058f9b442bd /dev-python/pytest-xdist
parentdev-python/pytest-xdist: Bump to 2.2.0 (diff)
downloadgentoo-40d346e878a71971c84c7ee0cc1024f05e2823ac.tar.gz
gentoo-40d346e878a71971c84c7ee0cc1024f05e2823ac.tar.bz2
gentoo-40d346e878a71971c84c7ee0cc1024f05e2823ac.zip
dev-python/pytest-xdist: Fix test failure w/ pytest-services
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pytest-xdist')
-rw-r--r--dev-python/pytest-xdist/files/pytest-xdist-2.2.0-services-conflict.patch31
-rw-r--r--dev-python/pytest-xdist/pytest-xdist-2.2.0.ebuild4
2 files changed, 35 insertions, 0 deletions
diff --git a/dev-python/pytest-xdist/files/pytest-xdist-2.2.0-services-conflict.patch b/dev-python/pytest-xdist/files/pytest-xdist-2.2.0-services-conflict.patch
new file mode 100644
index 000000000000..2c911601b070
--- /dev/null
+++ b/dev-python/pytest-xdist/files/pytest-xdist-2.2.0-services-conflict.patch
@@ -0,0 +1,31 @@
+From 082beb2ce0fe1f338311d85e656b962df8a16ce1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 15 Dec 2020 11:38:53 +0100
+Subject: [PATCH] Disable pytest-services plugin in test to avoid worker_id
+ conflict
+
+Pass "-p no:pytest-services" in test_worker_id_fixture() to ensure
+that the presence (and implicit loading) of pytest-services will not
+cause the test to fail via overriding worker name.
+
+Fixes #611
+---
+ testing/acceptance_test.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py
+index c273bfa..3bea8fc 100644
+--- a/testing/acceptance_test.py
++++ b/testing/acceptance_test.py
+@@ -1025,7 +1025,7 @@ def test_worker_id_fixture(testdir, n):
+ f.write(worker_id)
+ """
+ )
+- result = testdir.runpytest(f, "-n%d" % n)
++ result = testdir.runpytest(f, "-n%d" % n, "-p", "no:pytest-services")
+ result.stdout.fnmatch_lines("* 2 passed in *")
+ worker_ids = set()
+ for fname in glob.glob(str(testdir.tmpdir.join("*.txt"))):
+--
+2.29.2
+
diff --git a/dev-python/pytest-xdist/pytest-xdist-2.2.0.ebuild b/dev-python/pytest-xdist/pytest-xdist-2.2.0.ebuild
index 6bd046986b60..7cb664b2df30 100644
--- a/dev-python/pytest-xdist/pytest-xdist-2.2.0.ebuild
+++ b/dev-python/pytest-xdist/pytest-xdist-2.2.0.ebuild
@@ -29,4 +29,8 @@ BDEPEND="
)
"
+PATCHES=(
+ "${FILESDIR}"/${P}-services-conflict.patch
+)
+
distutils_enable_tests --install pytest