Commits

Floris Bruynooghe committed 2de862f

Fix existing tests

Ensure the plugin is loaded.

The order of the output depends on the order the plugins where loaded,
so make the checking of the output independent of this order.

  • Participants
  • Parent commits f25c657

Comments (0)

Files changed (1)

File test_pytest_capturelog.py

         import sys
         import logging
 
+        pytest_plugins = 'capturelog'
+
         def test_foo():
             sys.stdout.write('text going to stdout')
             sys.stderr.write('text going to stderr')
         ''')
     result = testdir.runpytest()
     assert result.ret == 1
-    assert result.stdout.fnmatch_lines([
-            '*- Captured log -*',
-            '*text going to logger*',
-            '*- Captured stdout -*',
-            'text going to stdout',
-            '*- Captured stderr -*',
-            'text going to stderr'
-            ])
+    fnmatch = result.stdout.fnmatch_lines
+    assert fnmatch(['*- Captured log -*', '*text going to logger*'])
+    assert fnmatch(['*- Captured stdout -*', 'text going to stdout'])
+    assert fnmatch(['*- Captured stderr -*', 'text going to stderr'])