test_examples(): avoid false positives from fuse debug output
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 6 Apr 2017 17:13:54 +0000 (10:13 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Fri, 7 Apr 2017 23:40:15 +0000 (16:40 -0700)
test/test_examples.py

index 7b0b664429492fa8add500fa85cac2d2e5caed2c..90d0218504cd5a617c426643bd1f644f12af98fa 100755 (executable)
@@ -63,7 +63,13 @@ def test_hello(tmpdir, name, options):
 @pytest.mark.parametrize("name", ('passthrough', 'passthrough_fh',
                                   'passthrough_ll'))
 @pytest.mark.parametrize("debug", (True, False))
-def test_passthrough(tmpdir, name, debug):
+def test_passthrough(tmpdir, name, debug, capfd):
+    
+    # Avoid false positives from libfuse debug messages
+    if debug:
+        capfd.register_output(r'^   unique: [0-9]+, error: -[0-9]+ .+$',
+                              count=0)
+
     is_ll = (name == 'passthrough_ll')
     mnt_dir = str(tmpdir.mkdir('mnt'))
     src_dir = str(tmpdir.mkdir('src'))