Skip to content

Commit 492d917

Browse files
committed
Drop unittest2 from test_functionality
test_hooks already imports unittest unconditionally.
1 parent 1736058 commit 492d917

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/test_functionality.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
import sys
33
import time
44
import threading
5+
import unittest
56
import yappi
67
import _yappi
78
import utils
89
import multiprocessing # added to fix http://bugs.python.org/issue15881 for > Py2.6
910
import subprocess
1011

11-
if sys.version_info < (2, 7): # use unittest2 for < Py2.7
12-
import unittest2 as _unittest
13-
else:
14-
import unittest as _unittest
1512

1613
class BasicUsage(utils.YappiUnitTestCase):
1714

@@ -964,7 +961,7 @@ def worker():
964961
#yappi.get_func_stats().sort("callcount").print_all()
965962
yappi.stop()
966963

967-
@_unittest.skipIf(os.name != "posix", "requires Posix compliant OS")
964+
@unittest.skipIf(os.name != "posix", "requires Posix compliant OS")
968965
def test_signals_with_blocking_calls(self):
969966
import signal, os, time
970967
# just to verify if signal is handled correctly and stats/yappi are not corrupted.
@@ -978,7 +975,7 @@ def handler(signum, frame):
978975
fsh = utils.find_stat_by_name(stats, "handler")
979976
self.assertTrue(fsh is not None)
980977

981-
@_unittest.skipIf(not sys.version_info >= (3, 2), "requires Python 3.2")
978+
@unittest.skipIf(not sys.version_info >= (3, 2), "requires Python 3.2")
982979
def test_concurrent_futures(self):
983980
yappi.start()
984981
from concurrent.futures import ThreadPoolExecutor
@@ -988,7 +985,7 @@ def test_concurrent_futures(self):
988985
time.sleep(1.0)
989986
yappi.stop()
990987

991-
@_unittest.skipIf(not sys.version_info >= (3, 2), "requires Python 3.2")
988+
@unittest.skipIf(not sys.version_info >= (3, 2), "requires Python 3.2")
992989
def test_barrier(self):
993990
yappi.start()
994991
b = threading.Barrier(2, timeout=1)
@@ -1414,4 +1411,4 @@ def b():
14141411
if __name__ == '__main__':
14151412
# import sys;sys.argv = ['', 'BasicUsage.test_run_as_script']
14161413
# import sys;sys.argv = ['', 'MultithreadedScenarios.test_subsequent_profile']
1417-
_unittest.main()
1414+
unittest.main()

0 commit comments

Comments
 (0)