summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dummy_threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dummy_threading.py')
-rw-r--r--Lib/test/test_dummy_threading.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/Lib/test/test_dummy_threading.py b/Lib/test/test_dummy_threading.py
index 2f59d5f..6ec5da3 100644
--- a/Lib/test/test_dummy_threading.py
+++ b/Lib/test/test_dummy_threading.py
@@ -1,4 +1,4 @@
-from test import test_support
+from test import support
import unittest
import dummy_threading as _threading
import time
@@ -15,21 +15,21 @@ class DummyThreadingTestCase(unittest.TestCase):
# module.
#delay = random.random() * 2
delay = 0
- if test_support.verbose:
- print 'task', self.name, 'will run for', delay, 'sec'
+ if support.verbose:
+ print('task', self.name, 'will run for', delay, 'sec')
sema.acquire()
mutex.acquire()
running += 1
- if test_support.verbose:
- print running, 'tasks are running'
+ if support.verbose:
+ print(running, 'tasks are running')
mutex.release()
time.sleep(delay)
- if test_support.verbose:
- print 'task', self.name, 'done'
+ if support.verbose:
+ print('task', self.name, 'done')
mutex.acquire()
running -= 1
- if test_support.verbose:
- print self.name, 'is finished.', running, 'tasks are running'
+ if support.verbose:
+ print(self.name, 'is finished.', running, 'tasks are running')
mutex.release()
sema.release()
@@ -49,15 +49,16 @@ class DummyThreadingTestCase(unittest.TestCase):
self.threads.append(t)
t.start()
- if test_support.verbose:
- print 'waiting for all tasks to complete'
+ if support.verbose:
+ print('waiting for all tasks to complete')
for t in self.threads:
t.join()
- if test_support.verbose:
- print 'all tasks done'
+ if support.verbose:
+ print('all tasks done')
def test_main():
- test_support.run_unittest(DummyThreadingTestCase)
+ support.run_unittest(DummyThreadingTestCase)
+
if __name__ == '__main__':
test_main()