diff test/test_postgresql.py @ 5109:43a1f7fe39f5

Improved work-around for pytest markers bug The previous fix was only a partial solution. Any test class sharing a parent with, and appearing after, a skipped test class was being skipped (not just other test classes using the skip/skipif marker). Now only tests that should be skipped will be skipped, the rest should run as normal.
author John Kristensen <john@jerrykan.com>
date Tue, 28 Jun 2016 15:39:38 +1000
parents 37d1e24fb941
children 57452bc6d989
line wrap: on
line diff
--- a/test/test_postgresql.py	Mon Jun 27 22:10:45 2016 -0400
+++ b/test/test_postgresql.py	Tue Jun 28 15:39:38 2016 +1000
@@ -26,11 +26,12 @@
 
 from roundup.backends import get_backend, have_backend
 
-# FIX: workaround for a bug in pytest.mark.skipif():
-#   https://github.com/pytest-dev/pytest/issues/568
 if not have_backend('postgresql'):
-    skip_postgresql = pytest.mark.skip(
-        reason='Skipping PostgreSQL tests: backend not available')
+    # FIX: workaround for a bug in pytest.mark.skip():
+    #   https://github.com/pytest-dev/pytest/issues/568
+    from .pytest_patcher import mark_class
+    skip_postgresql = mark_class(pytest.mark.skip(
+        reason='Skipping PostgreSQL tests: backend not available'))
 else:
     skip_postgresql = lambda func, *args, **kwargs: func
 

Roundup Issue Tracker: http://roundup-tracker.org/