diff tests/conftest.py @ 779:982de61e7da9

tests: Fix some CLI tests. Add auto-stripping of newlines in the CLI output for tests that use the simple YAML string value for the expected output. Also, fix `showconfig` test to expect a root URL with a trailing slash.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Jul 2016 15:04:36 +0200
parents 5e91bc0e3b4d
children 97c1dc568810
line wrap: on
line diff
--- a/tests/conftest.py	Sat Jul 16 15:02:24 2016 +0200
+++ b/tests/conftest.py	Sat Jul 16 15:04:36 2016 +0200
@@ -215,6 +215,9 @@
 
             if expected_out is not None:
                 actual_out = memstream.getvalue()
+                if not self.spec.get('no_strip'):
+                    actual_out = actual_out.rstrip(' \n')
+                    expected_out = expected_out.rstrip(' \n')
                 if self.spec.get('replace_out_path_sep'):
                     expected_out = expected_out.replace('/', os.sep)
                 assert expected_out == actual_out