diff options
| author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-17 23:22:06 +0100 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-21 19:06:16 +0100 |
| commit | b47b56dedba6c845925076d0dd07e373dac03d3a (patch) | |
| tree | 2cbeae10b6bba0d560588d9ab188b950034f7c1f /tests | |
| parent | 92cb458aa5c481877a57448299f784b83533be03 (diff) | |
| download | astroid-git-b47b56dedba6c845925076d0dd07e373dac03d3a.tar.gz | |
Remove redundant open mode 'r' in opens
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unittest_manager.py | 2 | ||||
| -rw-r--r-- | tests/unittest_nodes.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/unittest_manager.py b/tests/unittest_manager.py index ae0941bf..4aa6e4ba 100644 --- a/tests/unittest_manager.py +++ b/tests/unittest_manager.py @@ -77,7 +77,7 @@ class AstroidManagerTest( filepath = unittest.__file__ dirname = os.path.dirname(filepath) modname = os.path.basename(dirname) - with open(filepath, "r") as file: + with open(filepath) as file: data = file.read() ast = self.manager.ast_from_string(data, modname, filepath) self.assertEqual(ast.name, "unittest") diff --git a/tests/unittest_nodes.py b/tests/unittest_nodes.py index 7d53f6ac..488864f7 100644 --- a/tests/unittest_nodes.py +++ b/tests/unittest_nodes.py @@ -118,14 +118,14 @@ class AsStringTest(resources.SysPathSetup, unittest.TestCase): """check as_string on a whole module prepared to be returned identically """ module = resources.build_file("data/module.py", "data.module") - with open(resources.find("data/module.py"), "r") as fobj: + with open(resources.find("data/module.py")) as fobj: self.assertMultiLineEqual(module.as_string(), fobj.read()) def test_module2_as_string(self): """check as_string on a whole module prepared to be returned identically """ module2 = resources.build_file("data/module2.py", "data.module2") - with open(resources.find("data/module2.py"), "r") as fobj: + with open(resources.find("data/module2.py")) as fobj: self.assertMultiLineEqual(module2.as_string(), fobj.read()) def test_as_string(self): |
