Skip to content

Commit ff40023

Browse files
committed
Add unittest2 for py2
1 parent c8cf4e2 commit ff40023

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

friendlylog/simple_logger.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def set_fmt(fmt_string):
5757
_logger.setLevel(logging.DEBUG)
5858

5959

60-
6160
# Export functions and objects.
6261
inner_logger = _logger # Don't use this except if you know what you are doing.
6362
inner_stream_handler = _stream_handler # Same thing for this object.

tests/test_colored_logger.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
from friendlylog import colored_logger as logger
99
from threading import Thread
1010

11+
if six.PY2:
12+
import unittest2 as unittest
13+
else:
14+
import unittest
15+
16+
1117

1218
# Tests cannot be executed in parallel due to the hack in the setUp method.
1319
class TestColoredLogger(unittest.TestCase):

tests/test_simple_logger.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
import random
44
import six
55
import string
6-
import unittest
76

87
from friendlylog import simple_logger as logger
9-
108
from threading import Thread
119

10+
if six.PY2:
11+
import unittest2 as unittest
12+
else:
13+
import unittest
14+
1215

1316
# Tests cannot be executed in parallel due to the hack in the setUp method.
1417
class TestSimpleLogger(unittest.TestCase):

0 commit comments

Comments
 (0)