Skip to content

Commit

Permalink
Fix tests.MockTTY.clear() on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
avylove committed Jul 22, 2021
1 parent 02792c9 commit 455b653
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def close(self):
self.stdread.close()

def clear(self):
termios.tcflush(self.stdread, termios.TCIFLUSH)
# Using TCIOFLUSH here instead of TCIFLUSH to support MacOS
termios.tcflush(self.stdread, termios.TCIOFLUSH)

def resize(self, height, width):
fcntl.ioctl(self.slave, termios.TIOCSWINSZ, struct.pack('hhhh', height, width, 0, 0))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def test_autorefresh(self):
# Counter 1 in auto-refresh list
self.assertIn(counter1, manager.autorefresh)

# If auto-refreshed counter hasn't been refreshed recently refresh
# If auto-refreshed counter hasn't been refreshed recently, refresh
counter1.last_update = 0
counter2.refresh()
self.tty.stdout.write(u'X\n')
Expand Down

0 comments on commit 455b653

Please sign in to comment.