[3.11] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH-110505)

(cherry picked from commit b987fdb19b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-10-07 06:24:27 -07:00 committed by GitHub
parent 682321292f
commit af168df78f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3590,9 +3590,10 @@ class Rot13UtilTest(unittest.TestCase):
$ echo "Hello World" | python -m encodings.rot_13
"""
def test_rot13_func(self):
from encodings.rot_13 import rot13
infile = io.StringIO('Gb or, be abg gb or, gung vf gur dhrfgvba')
outfile = io.StringIO()
encodings.rot_13.rot13(infile, outfile)
rot13(infile, outfile)
outfile.seek(0)
plain_text = outfile.read()
self.assertEqual(