summaryrefslogtreecommitdiff
path: root/dev-python/pytest/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-08-02 19:14:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-08-02 19:14:55 +0100
commitb24bd25253fe093f722ab576d29fdc41d04cb1ee (patch)
tree0fcf2afd9f852c4d4c291cf8afaa2c244d598105 /dev-python/pytest/files
parent121ed4eec41fbf03e1998d09eede1bf449da63b9 (diff)
gentoo resync : 02.08.2019
Diffstat (limited to 'dev-python/pytest/files')
-rw-r--r--dev-python/pytest/files/pytest-5.0.1-test_xfail_rmdir.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/dev-python/pytest/files/pytest-5.0.1-test_xfail_rmdir.patch b/dev-python/pytest/files/pytest-5.0.1-test_xfail_rmdir.patch
new file mode 100644
index 000000000000..5c6154cd92c0
--- /dev/null
+++ b/dev-python/pytest/files/pytest-5.0.1-test_xfail_rmdir.patch
@@ -0,0 +1,38 @@
+From ab39502c98f40c03a2956dcf6c6b9daf5ee41a63 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Fri, 26 Jul 2019 02:23:14 +0200
+Subject: [PATCH] In test_xfail_handling, only remove __pycache__ if it exists
+
+Previously, the test failed when the directory was not present,
+which could have been caused for example by invoking the tests
+with PYTHONDONTWRITEBYTECODE=1.
+
+Fixes https://github.com/pytest-dev/pytest/issues/5664
+---
+ changelog/5664.trivial.rst | 2 ++
+ testing/test_stepwise.py | 3 ++-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 changelog/5664.trivial.rst
+
+diff --git a/changelog/5664.trivial.rst b/changelog/5664.trivial.rst
+new file mode 100644
+index 000000000..3928454ef
+--- /dev/null
++++ b/changelog/5664.trivial.rst
+@@ -0,0 +1,2 @@
++When invoking pytest's own testsuite with ``PYTHONDONTWRITEBYTECODE=1``,
++the ``test_xfail_handling`` test no longer fails.
+diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py
+index 591d67b6c..f61425b6b 100644
+--- a/testing/test_stepwise.py
++++ b/testing/test_stepwise.py
+@@ -207,7 +207,8 @@ def test_d(): pass
+
+ # because we are writing to the same file, mtime might not be affected enough to
+ # invalidate the cache, making this next run flaky
+- testdir.tmpdir.join("__pycache__").remove()
++ if testdir.tmpdir.join("__pycache__").exists():
++ testdir.tmpdir.join("__pycache__").remove()
+ testdir.makepyfile(contents.format(assert_value="0", strict="True"))
+ result = testdir.runpytest("--sw", "-v")
+ result.stdout.fnmatch_lines(