diff options
author | Thomas Kluyver <takowl@gmail.com> | 2013-09-19 17:10:56 -0700 |
---|---|---|
committer | Thomas Kluyver <takowl@gmail.com> | 2013-09-19 17:10:56 -0700 |
commit | 9c8e069026b55357b63def1bc8a39d567f41a405 (patch) | |
tree | 6b305560365c9703d86f6170df8b9d7855646bda /tests/test_ansi.py | |
parent | 9ee22124477a882836330264be855e1ee138c035 (diff) | |
download | pexpect-git-9c8e069026b55357b63def1bc8a39d567f41a405.tar.gz |
Fix pexpect.FSM for Python 3
Diffstat (limited to 'tests/test_ansi.py')
-rwxr-xr-x | tests/test_ansi.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_ansi.py b/tests/test_ansi.py index ecfbe77..f751f39 100755 --- a/tests/test_ansi.py +++ b/tests/test_ansi.py @@ -115,13 +115,15 @@ class ansiTestCase (PexpectTestCase.PexpectTestCase): assert str(s) == write_target def test_torturet (self): s = ANSI.ANSI (24,80) - sample_text = open ('torturet.vt').read() + with open('torturet.vt') as f: + sample_text = f.read() for c in sample_text: s.process (c) assert s.pretty() == torture_target, 'processed: \n' + s.pretty() + '\nexpected:\n' + torture_target def test_tetris (self): s = ANSI.ANSI (24,80) - tetris_text = open ('tetris.data').read() + with open('tetris.data') as f: + tetris_text = f.read() for c in tetris_text: s.process (c) assert str(s) == tetris_target |