Skip to content

Commit 69b19bc

Browse files
author
Erlend E. Aasland
committed
Decorate tests with @cpython_only
1 parent 45169ff commit 69b19bc

File tree

6 files changed

+8
-1
lines changed

6 files changed

+8
-1
lines changed

Lib/test/test_functools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ class TestCmpToKeyC(TestCmpToKey, unittest.TestCase):
948948
if c_functools:
949949
cmp_to_key = c_functools.cmp_to_key
950950

951+
@support.cpython_only
951952
def test_uninitialised_new(self):
952953
# Prevent heap types from being created uninitialised (bpo-43916)
953954
self.assertRaises(TypeError, type(c_functools.cmp_to_key(None)))

Lib/test/test_posix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def tearDown(self):
5858
os_helper.unlink(teardown_file)
5959
self._warnings_manager.__exit__(None, None, None)
6060

61+
@support.cpython_only
6162
def test_uninitialised_new(self):
6263
# Prevent heap types from being created uninitialised (bpo-43916)
6364
self.assertRaises(TypeError, posix.DirEntry)

Lib/test/test_re.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,7 @@ def test_signedness(self):
22152215
self.assertGreaterEqual(sre_compile.MAXREPEAT, 0)
22162216
self.assertGreaterEqual(sre_compile.MAXGROUPS, 0)
22172217

2218+
@cpython_only
22182219
def test_uninitialised_new(self):
22192220
# Prevent heap types from being created uninitialised (bpo-43916)
22202221
self.assertRaises(TypeError, re.Match)

Lib/test/test_threading.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def func(): pass
119119
thread = threading.Thread(target=func)
120120
self.assertEqual(thread.name, "Thread-5 (func)")
121121

122+
@cpython_only
122123
def test_uninitialised_new(self):
123124
# Prevent heap types from being created uninitialised (bpo-43916)
124125
lock = threading.Lock()

Lib/test/test_unicodedata.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import sys
1212
import unicodedata
1313
import unittest
14-
from test.support import open_urlresource, requires_resource, script_helper
14+
from test.support import (open_urlresource, requires_resource, script_helper,
15+
cpython_only)
1516

1617

1718
class UnicodeMethodsTest(unittest.TestCase):
@@ -225,6 +226,7 @@ def test_east_asian_width_9_0_changes(self):
225226

226227
class UnicodeMiscTest(UnicodeDatabaseTest):
227228

229+
@support.cpython_only
228230
def test_uninitialised_new(self):
229231
# Prevent heap types from being created uninitialised (bpo-43916)
230232
self.assertRaises(TypeError, unicodedata.UCD)

Lib/test/test_zlib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def test_overflow(self):
129129
with self.assertRaisesRegex(OverflowError, 'int too large'):
130130
zlib.decompressobj().flush(sys.maxsize + 1)
131131

132+
@support.cpython_only
132133
def test_uninitialised_new(self):
133134
# Prevent heap types from being created uninitialised (bpo-43916)
134135
comp = zlib.compressobj()

0 commit comments

Comments
 (0)