Skip to content

Commit

Permalink
Python 3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
magmax committed May 26, 2014
1 parent efc9b72 commit 07df055
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tests/features/test_colorize_executed_command.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from __future__ import unicode_literals
import unittest
import pexpect


class stdin_is_colorized_test(unittest.TestCase):
def test_valid_output(self):
self.sut = pexpect.spawn('python -m colorize echo FAILURE',
timeout=1)
self.sut = pexpect.spawnu('python -m colorize echo FAILURE',
timeout=1)

self.sut.expect_exact('\x1b[1;37;41mFAILURE\x1b[m'.encode('utf-8'))
self.sut.expect_exact('\x1b[1;37;41mFAILURE\x1b[m')
self.assertEquals(0, self.sut.wait())

def test_returns_2_if_child_returns_2(self):
Expand Down
3 changes: 2 additions & 1 deletion tests/features/test_colorize_stdin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import unicode_literals
import unittest
import pexpect

Expand All @@ -24,5 +25,5 @@ def test_failure_is_highlighted(self):
self.sut.sendline('FAILURE')
self.sut.sendeof()

self.sut.expect_exact('\x1b[1;37;41mFAILURE\x1b[m'.encode('utf-8'))
self.sut.expect_exact('\x1b[1;37;41mFAILURE\x1b[m')
self.assertEquals(0, self.sut.wait())

0 comments on commit 07df055

Please sign in to comment.