diff options
author | Harel Ben-Attia <harelba@gmail.com> | 2018-12-21 17:43:22 +0200 |
---|---|---|
committer | Harel Ben-Attia <harelba@gmail.com> | 2018-12-21 17:43:22 +0200 |
commit | 27a3b1e7424f28edd4c46d399e443aaae35d5f7d (patch) | |
tree | 259aca661cc87d012d412c5561279912131ee4ec | |
parent | c9911809f96c7c37ea1722203fa57f2216737b85 (diff) |
handle python 3.7 universal file mode flag deprecation
-rwxr-xr-x | test/test-suite | 11 |
1 files changed, 10 insertions, 1 deletions
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)) |