summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Mueller <30130371+cdce8p@users.noreply.github.com>2021-08-02 12:21:02 +0200
committerGitHub <noreply@github.com>2021-08-02 12:21:02 +0200
commitdaf4f1af5c04639f98e36c593667032dc23679ab (patch)
tree443442b702595e25a5ce83a48a0874a764f9041e /tests
parentd89e05435d84cc046dc22fd6e516c4ab80593453 (diff)
downloadastroid-git-daf4f1af5c04639f98e36c593667032dc23679ab.tar.gz
Update pylint to 2.9.6 (#1114)
* Update pylint to v2.9.6 * Code updates
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest_manager.py2
-rw-r--r--tests/unittest_modutils.py2
-rw-r--r--tests/unittest_nodes.py6
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/unittest_manager.py b/tests/unittest_manager.py
index bb128474..2bed335b 100644
--- a/tests/unittest_manager.py
+++ b/tests/unittest_manager.py
@@ -79,7 +79,7 @@ class AstroidManagerTest(
filepath = unittest.__file__
dirname = os.path.dirname(filepath)
modname = os.path.basename(dirname)
- with open(filepath) as file:
+ with open(filepath, encoding="utf-8") as file:
data = file.read()
ast = self.manager.ast_from_string(data, modname, filepath)
self.assertEqual(ast.name, "unittest")
diff --git a/tests/unittest_modutils.py b/tests/unittest_modutils.py
index 254ada24..13268f4c 100644
--- a/tests/unittest_modutils.py
+++ b/tests/unittest_modutils.py
@@ -181,7 +181,7 @@ class ModPathFromFileTest(unittest.TestCase):
self.addCleanup(os.remove, path_to_include)
except OSError:
pass
- with open(real_secret_path, "w"):
+ with open(real_secret_path, "w", encoding="utf-8"):
pass
os.symlink(real_secret_path, symlink_secret_path)
self.addCleanup(os.remove, real_secret_path)
diff --git a/tests/unittest_nodes.py b/tests/unittest_nodes.py
index 60909bf2..d935c487 100644
--- a/tests/unittest_nodes.py
+++ b/tests/unittest_nodes.py
@@ -117,13 +117,13 @@ class AsStringTest(resources.SysPathSetup, unittest.TestCase):
def test_module_as_string(self):
"""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")) as fobj:
+ with open(resources.find("data/module.py"), encoding="utf-8") 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")) as fobj:
+ with open(resources.find("data/module2.py"), encoding="utf-8") as fobj:
self.assertMultiLineEqual(module2.as_string(), fobj.read())
def test_as_string(self):
@@ -215,7 +215,7 @@ y = (3).imag
self.assertEqual(ast.as_string().strip(), code.strip())
def test_operator_precedence(self):
- with open(resources.find("data/operator_precedence.py")) as f:
+ with open(resources.find("data/operator_precedence.py"), encoding="utf-8") as f:
for code in f:
self.check_as_string_ast_equality(code)