Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchy committed Oct 23, 2018
1 parent 70b6030 commit 2c395f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion colorama/tests/initialise_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mock import patch

from ..ansitowin32 import StreamWrapper
from ..initialise import init
from ..initialise import init, deinit
from .utils import osname, redirected_output, replace_by

orig_stdout = sys.stdout
Expand All @@ -22,6 +22,7 @@ def setUp(self):
def tearDown(self):
sys.stdout = orig_stdout
sys.stderr = orig_stderr
deinit()

def assertWrapped(self):
self.assertIsNot(sys.stdout, orig_stdout, 'stdout should be wrapped')
Expand Down Expand Up @@ -96,11 +97,13 @@ def testAutoResetPassedOn(self, mockATW32, _):
def testAutoResetChangeable(self, mockATW32):
with osname("nt"):
init()
deinit()

init(autoreset=True)
self.assertEqual(len(mockATW32.call_args_list), 4)
self.assertEqual(mockATW32.call_args_list[2][1]['autoreset'], True)
self.assertEqual(mockATW32.call_args_list[3][1]['autoreset'], True)
deinit()

init()
self.assertEqual(len(mockATW32.call_args_list), 6)
Expand Down

0 comments on commit 2c395f8

Please sign in to comment.