diff test/test_dates.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 64c4e43fbb84
line wrap: on
line diff
--- a/test/test_dates.py	Mon Jun 27 22:10:45 2016 -0400
+++ b/test/test_dates.py	Tue Jun 28 15:39:38 2016 +1000
@@ -25,13 +25,14 @@
 from roundup.date import Date, Interval, Range, fixTimeOverflow, \
     get_timezone
 
-# FIX: workaround for a bug in pytest.mark.skipif():
-#   https://github.com/pytest-dev/pytest/issues/568
 try:
     import pytz
     skip_pytz = lambda func, *args, **kwargs: func
 except ImportError:
-    skip_pytz = pytest.mark.skip(reason="'pytz' not installed")
+    # FIX: workaround for a bug in pytest.mark.skip():
+    #   https://github.com/pytest-dev/pytest/issues/568
+    from .pytest_patcher import mark_class
+    skip_pytz = mark_class(pytest.mark.skip(reason="'pytz' not installed"))
 
 
 class DateTestCase(unittest.TestCase):

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