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.

Comments (0)

Files changed (1)

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'])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.