38 lines
1.4 KiB
Diff
38 lines
1.4 KiB
Diff
From 989e13e0514a97cd01234233dd85ebbd2805a3bb Mon Sep 17 00:00:00 2001
|
|
From: Adam Williamson <awilliam@redhat.com>
|
|
Date: Wed, 9 May 2018 15:50:50 -0700
|
|
Subject: [PATCH] Skip tests that use 'xprocess' fixture when not installed
|
|
|
|
There's already a little trick to skip tests that use a fixture
|
|
called 'subprocess' when pytest-xprocess is not installed, but
|
|
many tests use the 'xprocess' fixture directly, and all of those
|
|
will still just fail. This just defines a dummy 'xprocess'
|
|
fixture as well as the dummy 'subprocess' fixture when xprocess
|
|
is not installed, so those tests as well will be skipped instead
|
|
of failing.
|
|
|
|
I noticed this when trying to run the test suite during build
|
|
of the Fedora package - xprocess isn't packaged for Fedora yet,
|
|
so there's no way to run the tests that use it unfortunately.
|
|
|
|
Signed-off-by: Adam Williamson <awilliam@redhat.com>
|
|
---
|
|
tests/conftest.py | 4 ++++
|
|
1 file changed, 4 insertions(+)
|
|
|
|
diff --git a/tests/conftest.py b/tests/conftest.py
|
|
index ce885777a..f4611d9d0 100644
|
|
--- a/tests/conftest.py
|
|
+++ b/tests/conftest.py
|
|
@@ -29,6 +29,10 @@
|
|
@pytest.fixture(scope='session')
|
|
def subprocess():
|
|
pytest.skip('pytest-xprocess not installed.')
|
|
+
|
|
+ @pytest.fixture(scope='session')
|
|
+ def xprocess():
|
|
+ pytest.skip('pytest-xprocess not installed.')
|
|
else:
|
|
@pytest.fixture(scope='session')
|
|
def subprocess(xprocess):
|