summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2018-12-21 17:47:02 +0200
committerHarel Ben-Attia <harelba@gmail.com>2018-12-21 17:47:02 +0200
commit746cb9f67657c9d484befbe15862d788b18be876 (patch)
treecb3d0b635d221eec00cc9b8a5a6d71b535bfd4e7
parentf0b62b15b91583cd944ea2e8daf6f730198959fa (diff)
handle python 3.7 deprecation warning for universal file modemore-py3-stuff
-rwxr-xr-xtest/test-suite10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test-suite b/test/test-suite
index 978a58b..e17afcd 100755
--- a/test/test-suite
+++ b/test/test-suite
@@ -1841,7 +1841,15 @@ class FormattingTests(AbstractQTestCase):
retcode, o, e = run_command(cmd)
self.assertEqual(retcode,0)
- self.assertEqual(len(e), 0)
+
+ if len(e) == 2:
+ # In python 3.7, there's a deprecation warning for the 'U' file opening mode, which is ok for now
+ self.assertEqual(len(e), 2)
+ self.assertTrue(b"DeprecationWarning: 'U' mode is deprecated" in e[0])
+ elif len(e) != 0:
+ # Nothing should be output to stderr in other versions
+ self.assertTrue(False,msg='Unidentified output in stderr')
+
self.assertEqual(len(o), 6)
actual_output = list(map(lambda row: row.split(six.b(",")),o))