diff test/test_indexer.py @ 5105:37d1e24fb941

Fix work-around for pytest markers bug The initial work-around implemented was totally botched using 'pytest.skip' instead of 'pytest.mark.skip' which resulted in all tests in a file being completely ignored if any skip conditions that evaluated to true were declared or imported in the file. This work-around will not correctly display why all the tests have been skipped when using the '-rs' parameter. Only the first skip marker to taint a parent test class will be displayed (ie. if both xapian and mysql tests are being skipped, pytest will only output that tests are being skipped because xapian is not installed even though the mysql tests are also being skipped because mysql backend is not available). There also seems to be a bug in the current version of pytest being used in 'run_tests.py' (v2.8.4) that results in the skip not actually working when using 'pytest.mark.skip'. This does work correctly with the most recent release (v2.9.2), so the 'run_tests.py' script will need to be updated.
author John Kristensen <john@jerrykan.com>
date Mon, 27 Jun 2016 14:03:32 +1000
parents e74c3611b138
children 43a1f7fe39f5
line wrap: on
line diff
--- a/test/test_indexer.py	Sun Jun 26 22:10:40 2016 -0400
+++ b/test/test_indexer.py	Mon Jun 27 14:03:32 2016 +1000
@@ -36,16 +36,17 @@
     import xapian
     skip_xapian = lambda func, *args, **kwargs: func
 except ImportError:
-    skip_xapian = pytest.skip(
+    skip_xapian = pytest.mark.skip(
         "Skipping Xapian indexer tests: 'xapian' not installed")
 
 try:
     import whoosh
     skip_whoosh = lambda func, *args, **kwargs: func
 except ImportError:
-    skip_whoosh = pytest.skip(
+    skip_whoosh = pytest.mark.skip(
         "Skipping Whoosh indexer tests: 'whoosh' not installed")
 
+
 class db:
     class config(dict):
         DATABASE = 'test-index'

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