diff options
| author | Thomas Kluyver <thomas@kluyver.me.uk> | 2017-07-19 15:05:01 +0100 |
|---|---|---|
| committer | Thomas Kluyver <thomas@kluyver.me.uk> | 2017-07-19 15:05:01 +0100 |
| commit | 1eeddba2ef433cb23cefe8adc064f13a4b9265fa (patch) | |
| tree | 7f00c84456dcfe8ff326e17194f16006d449ff59 /tests/test_async.py | |
| parent | 94f91bd8c56f5e277a9859129ee9260658fd170a (diff) | |
| download | pexpect-1eeddba2ef433cb23cefe8adc064f13a4b9265fa.tar.gz | |
Rename async= parameter to async_=
Closes gh-315
Diffstat (limited to 'tests/test_async.py')
| -rw-r--r-- | tests/test_async.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/test_async.py b/tests/test_async.py index 1a15524..1cc3236 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -18,53 +18,53 @@ class AsyncTests(PexpectTestCase): def test_simple_expect(self): p = pexpect.spawn('cat') p.sendline('Hello asyncio') - coro = p.expect(['Hello', pexpect.EOF] , async=True) + coro = p.expect(['Hello', pexpect.EOF] , async_=True) assert run(coro) == 0 print('Done') def test_timeout(self): p = pexpect.spawn('cat') - coro = p.expect('foo', timeout=1, async=True) + coro = p.expect('foo', timeout=1, async_=True) with self.assertRaises(pexpect.TIMEOUT): run(coro) p = pexpect.spawn('cat') - coro = p.expect(['foo', pexpect.TIMEOUT], timeout=1, async=True) + coro = p.expect(['foo', pexpect.TIMEOUT], timeout=1, async_=True) assert run(coro) == 1 def test_eof(self): p = pexpect.spawn('cat') p.sendline('Hi') - coro = p.expect(pexpect.EOF, async=True) + coro = p.expect(pexpect.EOF, async_=True) p.sendeof() assert run(coro) == 0 p = pexpect.spawn('cat') p.sendeof() - coro = p.expect('Blah', async=True) + coro = p.expect('Blah', async_=True) with self.assertRaises(pexpect.EOF): run(coro) def test_expect_exact(self): p = pexpect.spawn('%s list100.py' % sys.executable) - assert run(p.expect_exact(b'5', async=True)) == 0 - assert run(p.expect_exact(['wpeok', b'11'], async=True)) == 1 - assert run(p.expect_exact([b'foo', pexpect.EOF], async=True)) == 1 + assert run(p.expect_exact(b'5', async_=True)) == 0 + assert run(p.expect_exact(['wpeok', b'11'], async_=True)) == 1 + assert run(p.expect_exact([b'foo', pexpect.EOF], async_=True)) == 1 def test_async_utf8(self): p = pexpect.spawn('%s list100.py' % sys.executable, encoding='utf8') - assert run(p.expect_exact(u'5', async=True)) == 0 - assert run(p.expect_exact([u'wpeok', u'11'], async=True)) == 1 - assert run(p.expect_exact([u'foo', pexpect.EOF], async=True)) == 1 + assert run(p.expect_exact(u'5', async_=True)) == 0 + assert run(p.expect_exact([u'wpeok', u'11'], async_=True)) == 1 + assert run(p.expect_exact([u'foo', pexpect.EOF], async_=True)) == 1 def test_async_and_gc(self): p = pexpect.spawn('%s sleep_for.py 1' % sys.executable, encoding='utf8') - assert run(p.expect_exact(u'READY', async=True)) == 0 + assert run(p.expect_exact(u'READY', async_=True)) == 0 gc.collect() - assert run(p.expect_exact(u'END', async=True)) == 0 + assert run(p.expect_exact(u'END', async_=True)) == 0 def test_async_and_sync(self): p = pexpect.spawn('echo 1234', encoding='utf8', maxread=1) - assert run(p.expect_exact(u'1', async=True)) == 0 + assert run(p.expect_exact(u'1', async_=True)) == 0 assert p.expect_exact(u'2') == 0 - assert run(p.expect_exact(u'3', async=True)) == 0 + assert run(p.expect_exact(u'3', async_=True)) == 0 |
