diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-08-12 10:28:03 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2021-08-12 13:53:18 +0200 |
commit | bec1cbde23681595952b3604448b323000a2b49e (patch) | |
tree | eff41917641865d00261cb59487ceb8001975239 /xtesting/tests/unit/core/test_unit.py | |
parent | 569599f5950fcbf9c2c9f0fdf5f4b469babe573a (diff) |
Update pylint to 2.9.6
It stops filtering upper constraints by versions as python 2 (and 3.5)
dropped.
Change-Id: Ieb96d068ebda813e020a093f3291b4a9526402e4
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'xtesting/tests/unit/core/test_unit.py')
-rw-r--r-- | xtesting/tests/unit/core/test_unit.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xtesting/tests/unit/core/test_unit.py b/xtesting/tests/unit/core/test_unit.py index 86577713..9e5f1321 100644 --- a/xtesting/tests/unit/core/test_unit.py +++ b/xtesting/tests/unit/core/test_unit.py @@ -32,10 +32,11 @@ class SuiteTesting(unittest.TestCase): args[0].assert_called_once_with( ['subunit-stats'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) - @mock.patch('subprocess.Popen', - return_value=mock.Mock( - communicate=mock.Mock(return_value=(b"foo", b"bar")))) + @mock.patch('subprocess.Popen') def test_generate_stats_ok(self, *args): + attrs = {'return_value.__enter__.return_value': mock.Mock( + communicate=mock.Mock(return_value=(b"foo", b"bar")))} + args[0].configure_mock(**attrs) stream = io.StringIO() self.psrunner.generate_stats(stream) args[0].assert_called_once_with( @@ -55,10 +56,11 @@ class SuiteTesting(unittest.TestCase): mock_open.assert_called_once_with( '{}/results.xml'.format(self.psrunner.res_dir), 'w') - @mock.patch('subprocess.Popen', - return_value=mock.Mock( - communicate=mock.Mock(return_value=(b"foo", b"bar")))) + @mock.patch('subprocess.Popen') def test_generate_xunit_ok(self, *args): + attrs = {'return_value.__enter__.return_value': mock.Mock( + communicate=mock.Mock(return_value=(b"foo", b"bar")))} + args[0].configure_mock(**attrs) stream = io.BytesIO() with mock.patch('builtins.open', mock.mock_open()) as mock_open: |