diff options
author | Inada Naoki <songofacandy@gmail.com> | 2021-04-02 03:53:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 03:53:46 (GMT) |
commit | 8bbfeb3330c10d52274bb85fce59ae614f0500bf (patch) | |
tree | e599878998ff1f8b1cf61bce14ff2a2037871a87 /Lib/test/test_support.py | |
parent | bef7b26f7229f8b7cde843118a7bc7e2b00f0372 (diff) | |
download | cpython-8bbfeb3330c10d52274bb85fce59ae614f0500bf.zip cpython-8bbfeb3330c10d52274bb85fce59ae614f0500bf.tar.gz cpython-8bbfeb3330c10d52274bb85fce59ae614f0500bf.tar.bz2 |
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142)
* test__xxsubinterpreters
* test_builtin
* test_doctest
* test_exceptions
* test_opcodes
* test_support
* test_argparse
* test_baseexception
* test_bdb
* test_bool
* test_asdl_parser
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r-- | Lib/test/test_support.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 71a66c2..55d78b7 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -47,7 +47,7 @@ class TestSupport(unittest.TestCase): self.assertNotIn("sched", sys.modules) def test_unlink(self): - with open(TESTFN, "w") as f: + with open(TESTFN, "w", encoding="utf-8") as f: pass os_helper.unlink(TESTFN) self.assertFalse(os.path.exists(TESTFN)) @@ -79,7 +79,7 @@ class TestSupport(unittest.TestCase): def test_forget(self): mod_filename = TESTFN + '.py' - with open(mod_filename, 'w') as f: + with open(mod_filename, 'w', encoding="utf-8") as f: print('foo = 1', file=f) sys.path.insert(0, os.curdir) importlib.invalidate_caches() |