From 27a3b1e7424f28edd4c46d399e443aaae35d5f7d Mon Sep 17 00:00:00 2001 From: Harel Ben-Attia Date: Fri, 21 Dec 2018 17:43:22 +0200 Subject: handle python 3.7 universal file mode flag deprecation --- test/test-suite | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/test-suite b/test/test-suite index 44bd334..af00795 100755 --- a/test/test-suite +++ b/test/test-suite @@ -1842,7 +1842,16 @@ 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)) -- cgit v1.2.3