summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_thread.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-08 06:44:27 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-08 06:44:27 (GMT)
commit101d9e7250c039aeabea1582459d40b52cc81024 (patch)
treee0a6990c763c2435fae0a08a4114ac17569aa261 /Lib/test/test_thread.py
parent5ca129b8f016668bf914592e58082c452a7ad9b4 (diff)
parent7ef00ff91a0a90a2b11df40d110365e6a7909a94 (diff)
downloadcpython-101d9e7250c039aeabea1582459d40b52cc81024.zip
cpython-101d9e7250c039aeabea1582459d40b52cc81024.tar.gz
cpython-101d9e7250c039aeabea1582459d40b52cc81024.tar.bz2
Issue 19572: More silently skipped tests explicitly skipped.
Diffstat (limited to 'Lib/test/test_thread.py')
-rw-r--r--Lib/test/test_thread.py50
1 files changed, 23 insertions, 27 deletions
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index f9a721b..6144901 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -68,39 +68,35 @@ class ThreadRunningTests(BasicThreadTest):
thread.stack_size(0)
self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
- if os.name not in ("nt", "posix"):
- return
-
- tss_supported = True
+ @unittest.skipIf(os.name not in ("nt", "posix"), 'test meant for nt and posix')
+ def test_nt_and_posix_stack_size(self):
try:
thread.stack_size(4096)
except ValueError:
verbose_print("caught expected ValueError setting "
"stack_size(4096)")
except thread.error:
- tss_supported = False
- verbose_print("platform does not support changing thread stack "
- "size")
-
- if tss_supported:
- fail_msg = "stack_size(%d) failed - should succeed"
- for tss in (262144, 0x100000, 0):
- thread.stack_size(tss)
- self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
- verbose_print("successfully set stack_size(%d)" % tss)
-
- for tss in (262144, 0x100000):
- verbose_print("trying stack_size = (%d)" % tss)
- self.next_ident = 0
- self.created = 0
- for i in range(NUMTASKS):
- self.newtask()
-
- verbose_print("waiting for all tasks to complete")
- self.done_mutex.acquire()
- verbose_print("all tasks done")
-
- thread.stack_size(0)
+ self.skipTest("platform does not support changing thread stack "
+ "size")
+
+ fail_msg = "stack_size(%d) failed - should succeed"
+ for tss in (262144, 0x100000, 0):
+ thread.stack_size(tss)
+ self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
+ verbose_print("successfully set stack_size(%d)" % tss)
+
+ for tss in (262144, 0x100000):
+ verbose_print("trying stack_size = (%d)" % tss)
+ self.next_ident = 0
+ self.created = 0
+ for i in range(NUMTASKS):
+ self.newtask()
+
+ verbose_print("waiting for all tasks to complete")
+ self.done_mutex.acquire()
+ verbose_print("all tasks done")
+
+ thread.stack_size(0)
def test__count(self):
# Test the _count() function.