Skip to content

Commit

Permalink
Use no_coverage_env for spawn(sigwinch_report.py)
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Sep 22, 2015
1 parent 6d7abc1 commit d511e33
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/test_winsize.py
Expand Up @@ -21,39 +21,43 @@
import pexpect
import unittest
from . import PexpectTestCase
from .utils import no_coverage_env
import time

class TestCaseWinsize(PexpectTestCase.PexpectTestCase):

def test_initial_winsize(self):
""" Assert initial window dimension size (24, 80). """
p = pexpect.spawn('{self.PYTHONBIN} sigwinch_report.py'
.format(self=self), timeout=3)
.format(self=self), timeout=3,
env=no_coverage_env())
# default size by PtyProcess class is 24 rows by 80 columns.
p.expect_exact('Initial Size: (24, 80)')
p.sendcontrol('c')
p.wait()
p.expect(pexpect.EOF)

def test_initial_winsize_by_dimension(self):
""" Assert user-parameter window dimension size is initial. """
p = pexpect.spawn('{self.PYTHONBIN} sigwinch_report.py'
.format(self=self), timeout=3,
dimensions=(40, 100))
dimensions=(40, 100),
env=no_coverage_env())
p.expect_exact('Initial Size: (40, 100)')
p.sendcontrol('c')
p.wait()
p.expect(pexpect.EOF)

def test_setwinsize(self):
""" Ensure method .setwinsize() sends signal caught by child. """
p = pexpect.spawn('{self.PYTHONBIN} sigwinch_report.py'
.format(self=self), timeout=3)
.format(self=self), timeout=3,
env=no_coverage_env())
# Note that we must await the installation of the child process'
# signal handler,
p.expect_exact('READY')
p.setwinsize(19, 84)
p.expect_exact('SIGWINCH: (19, 84)')
p.sendcontrol('c')
p.wait()
p.expect(pexpect.EOF)

if __name__ == '__main__':
unittest.main()
Expand Down

0 comments on commit d511e33

Please sign in to comment.