[ADD][TST] interact dead; [FIX] add workaround of unreachable codecov

This commit is contained in:
Benedek Racz 2019-12-05 17:27:02 +01:00
parent 2e6ac6bc1f
commit 9e26c67324
2 changed files with 20 additions and 2 deletions

View File

@ -21,7 +21,8 @@ test_script:
after_test:
# Upload code coverage results.
- codecov
# https://github.com/codecov/codecov-python/issues/158#issuecomment-514282362
- codecov --required || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required)
# fill .pypirc file.
# pypi

View File

@ -33,7 +33,7 @@ import unittest
from . import PexpectTestCase
class InteractTestCase(PexpectTestCase.PexpectTestCase):
def testPath(self):
def test_interact(self):
# Path of cmd executable:
cmd_exe = 'cmd'
cmdPrompt = '>'
@ -55,6 +55,23 @@ class InteractTestCase(PexpectTestCase.PexpectTestCase):
self.assertEqual('hello', p.before.splitlines()[1])
def test_interact_dead(self):
# Path of cmd executable:
echo = 'echo hello'
# Start the child process
p = wexpect.spawn(echo)
p.expect('hello')
time.sleep(0.5)
with self.assertRaises(wexpect.ExceptionPexpect):
p.interact()
with self.assertRaises(wexpect.ExceptionPexpect):
p.stop_interact()
if __name__ == '__main__':
unittest.main()