diff options
author | 2019-05-07 10:42:23 +0200 | |
---|---|---|
committer | 2019-05-23 21:01:23 +0200 | |
commit | efdca27a85b099f5ea684e15e0d46da6187d4dda (patch) | |
tree | 76f9511f6df7680377ffe32932b109544c294f20 /xtesting/tests/unit/core/test_unit.py | |
parent | 26a175e9379b5cde2dbfd36f914a617c41c65bd6 (diff) |
Update to Python3
Now Xtesting containers use Python3 instead of python2.
https://mail.python.org/pipermail/python-dev/2018-March/152348.html
It also updates robotframework to latest release.
Change-Id: I57e0d8b1af9aeaae0c445941a9bdf0b8bd346834
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 6f8aa2785e0239dbed22fcb4d093a5bc110bcc3c)
Diffstat (limited to 'xtesting/tests/unit/core/test_unit.py')
-rw-r--r-- | xtesting/tests/unit/core/test_unit.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xtesting/tests/unit/core/test_unit.py b/xtesting/tests/unit/core/test_unit.py index 20fd6959..0af3ddca 100644 --- a/xtesting/tests/unit/core/test_unit.py +++ b/xtesting/tests/unit/core/test_unit.py @@ -59,7 +59,7 @@ class SuiteTesting(unittest.TestCase): return_value=mock.Mock( communicate=mock.Mock(return_value=("foo", "bar")))) def test_generate_xunit_ok(self, *args): - stream = six.StringIO() + stream = six.BytesIO() with mock.patch('six.moves.builtins.open', mock.mock_open()) as mock_open: self.psrunner.generate_xunit(stream) @@ -96,7 +96,7 @@ class SuiteTesting(unittest.TestCase): with mock.patch('six.moves.builtins.open', mock.mock_open()) as m_open: self.assertEqual(self.psrunner.run(), status) m_open.assert_called_once_with( - '{}/subunit_stream'.format(self.psrunner.res_dir), 'w') + '{}/subunit_stream'.format(self.psrunner.res_dir), 'wb') self.assertEqual(self.psrunner.is_successful(), result) args[0].assert_called_once_with(self.psrunner.suite) args[1].assert_not_called() @@ -115,7 +115,7 @@ class SuiteTesting(unittest.TestCase): with mock.patch('six.moves.builtins.open', mock.mock_open()) as m_open: self.assertEqual(self.psrunner.run(name=name), status) m_open.assert_called_once_with( - '{}/subunit_stream'.format(self.psrunner.res_dir), 'w') + '{}/subunit_stream'.format(self.psrunner.res_dir), 'wb') self.assertEqual(self.psrunner.is_successful(), result) args[0].assert_called_once_with(self.psrunner.suite) args[1].assert_called_once_with() |