gh-109848: Make test_rot13_func in test_codecs independent (GH-109850)

This commit is contained in:
Serhiy Storchaka 2023-10-07 16:01:39 +03:00 committed by GitHub
parent 1aad4fc5db
commit b987fdb19b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3637,9 +3637,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(