mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue 19572: More silently skipped tests explicitly skipped.
This commit is contained in:
parent
774f909489
commit
9fe6d86709
34 changed files with 122 additions and 134 deletions
|
@ -2025,6 +2025,7 @@ class TestDateTime(TestDate):
|
||||||
class TestSubclassDateTime(TestDateTime):
|
class TestSubclassDateTime(TestDateTime):
|
||||||
theclass = SubclassDatetime
|
theclass = SubclassDatetime
|
||||||
# Override tests not designed for subclass
|
# Override tests not designed for subclass
|
||||||
|
@unittest.skip('not appropriate for subclasses')
|
||||||
def test_roundtrip(self):
|
def test_roundtrip(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ class TestBase:
|
||||||
|
|
||||||
def test_xmlcharrefreplace(self):
|
def test_xmlcharrefreplace(self):
|
||||||
if self.has_iso10646:
|
if self.has_iso10646:
|
||||||
return
|
self.skipTest('encoding contains full ISO 10646 map')
|
||||||
|
|
||||||
s = "\u0b13\u0b23\u0b60 nd eggs"
|
s = "\u0b13\u0b23\u0b60 nd eggs"
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
|
@ -83,7 +83,7 @@ class TestBase:
|
||||||
|
|
||||||
def test_customreplace_encode(self):
|
def test_customreplace_encode(self):
|
||||||
if self.has_iso10646:
|
if self.has_iso10646:
|
||||||
return
|
self.skipTest('encoding contains full ISO 10646 map')
|
||||||
|
|
||||||
from html.entities import codepoint2name
|
from html.entities import codepoint2name
|
||||||
|
|
||||||
|
|
|
@ -663,10 +663,10 @@ class BaseTest:
|
||||||
self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
|
self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
|
||||||
self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
|
self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
|
||||||
|
|
||||||
|
@unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4,
|
||||||
|
'only applies to 32-bit platforms')
|
||||||
def test_replace_overflow(self):
|
def test_replace_overflow(self):
|
||||||
# Check for overflow checking on 32 bit machines
|
# Check for overflow checking on 32 bit machines
|
||||||
if sys.maxsize != 2147483647 or struct.calcsize("P") > 4:
|
|
||||||
return
|
|
||||||
A2_16 = "A" * (2**16)
|
A2_16 = "A" * (2**16)
|
||||||
self.checkraises(OverflowError, A2_16, "replace", "", A2_16)
|
self.checkraises(OverflowError, A2_16, "replace", "", A2_16)
|
||||||
self.checkraises(OverflowError, A2_16, "replace", "A", A2_16)
|
self.checkraises(OverflowError, A2_16, "replace", "A", A2_16)
|
||||||
|
|
|
@ -946,7 +946,7 @@ class BaseTest:
|
||||||
try:
|
try:
|
||||||
import gc
|
import gc
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
self.skipTest('gc module not available')
|
||||||
a = array.array(self.typecode)
|
a = array.array(self.typecode)
|
||||||
l = [iter(a)]
|
l = [iter(a)]
|
||||||
l.append(l)
|
l.append(l)
|
||||||
|
|
|
@ -36,6 +36,7 @@ class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
|
||||||
|
|
||||||
# iso2022_kr.txt cannot be used to test "chunk coding": the escape
|
# iso2022_kr.txt cannot be used to test "chunk coding": the escape
|
||||||
# sequence is only written on the first line
|
# sequence is only written on the first line
|
||||||
|
@unittest.skip('iso2022_kr.txt cannot be used to test "chunk coding"')
|
||||||
def test_chunkcoding(self):
|
def test_chunkcoding(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -707,8 +707,7 @@ boolean {0[0]} NO
|
||||||
|
|
||||||
def test_read_returns_file_list(self):
|
def test_read_returns_file_list(self):
|
||||||
if self.delimiters[0] != '=':
|
if self.delimiters[0] != '=':
|
||||||
# skip reading the file if we're using an incompatible format
|
self.skipTest('incompatible format')
|
||||||
return
|
|
||||||
file1 = support.findfile("cfgparser.1")
|
file1 = support.findfile("cfgparser.1")
|
||||||
# check when we pass a mix of readable and non-readable files:
|
# check when we pass a mix of readable and non-readable files:
|
||||||
cf = self.newconfig()
|
cf = self.newconfig()
|
||||||
|
|
|
@ -290,7 +290,6 @@ class IBMTestCases(unittest.TestCase):
|
||||||
global skip_expected
|
global skip_expected
|
||||||
if skip_expected:
|
if skip_expected:
|
||||||
raise unittest.SkipTest
|
raise unittest.SkipTest
|
||||||
return
|
|
||||||
with open(file) as f:
|
with open(file) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.replace('\r\n', '').replace('\n', '')
|
line = line.replace('\r\n', '').replace('\n', '')
|
||||||
|
@ -301,7 +300,6 @@ class IBMTestCases(unittest.TestCase):
|
||||||
#Exception raised where there shouldn't have been one.
|
#Exception raised where there shouldn't have been one.
|
||||||
self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
|
self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
def eval_line(self, s):
|
def eval_line(self, s):
|
||||||
if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'):
|
if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'):
|
||||||
|
@ -461,7 +459,6 @@ class IBMTestCases(unittest.TestCase):
|
||||||
|
|
||||||
self.assertEqual(myexceptions, theirexceptions,
|
self.assertEqual(myexceptions, theirexceptions,
|
||||||
'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions))
|
'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions))
|
||||||
return
|
|
||||||
|
|
||||||
def getexceptions(self):
|
def getexceptions(self):
|
||||||
return [e for e in Signals[self.decimal] if self.context.flags[e]]
|
return [e for e in Signals[self.decimal] if self.context.flags[e]]
|
||||||
|
@ -1073,7 +1070,7 @@ class FormatTest(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
from locale import CHAR_MAX
|
from locale import CHAR_MAX
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
self.skipTest('locale.CHAR_MAX not available')
|
||||||
|
|
||||||
def make_grouping(lst):
|
def make_grouping(lst):
|
||||||
return ''.join([chr(x) for x in lst]) if self.decimal == C else lst
|
return ''.join([chr(x) for x in lst]) if self.decimal == C else lst
|
||||||
|
@ -1164,8 +1161,12 @@ class FormatTest(unittest.TestCase):
|
||||||
|
|
||||||
decimal_point = locale.localeconv()['decimal_point']
|
decimal_point = locale.localeconv()['decimal_point']
|
||||||
thousands_sep = locale.localeconv()['thousands_sep']
|
thousands_sep = locale.localeconv()['thousands_sep']
|
||||||
if decimal_point != '\u066b' or thousands_sep != '\u066c':
|
if decimal_point != '\u066b':
|
||||||
return
|
self.skipTest('inappropriate decimal point separator'
|
||||||
|
'({!r} not {!r})'.format(decimal_point, '\u066b'))
|
||||||
|
if thousands_sep != '\u066c':
|
||||||
|
self.skipTest('inappropriate thousands separator'
|
||||||
|
'({!r} not {!r})'.format(thousands_sep, '\u066c'))
|
||||||
|
|
||||||
self.assertEqual(format(Decimal('100000000.123'), 'n'),
|
self.assertEqual(format(Decimal('100000000.123'), 'n'),
|
||||||
'100\u066c000\u066c000\u066b123')
|
'100\u066c000\u066c000\u066b123')
|
||||||
|
@ -1515,7 +1516,6 @@ def thfunc1(cls):
|
||||||
cls.assertTrue(c1.flags[Inexact])
|
cls.assertTrue(c1.flags[Inexact])
|
||||||
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
|
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
|
||||||
cls.assertFalse(c1.flags[sig])
|
cls.assertFalse(c1.flags[sig])
|
||||||
return
|
|
||||||
|
|
||||||
def thfunc2(cls):
|
def thfunc2(cls):
|
||||||
Decimal = cls.decimal.Decimal
|
Decimal = cls.decimal.Decimal
|
||||||
|
@ -1560,7 +1560,6 @@ def thfunc2(cls):
|
||||||
cls.assertTrue(thiscontext.flags[Inexact])
|
cls.assertTrue(thiscontext.flags[Inexact])
|
||||||
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
|
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
|
||||||
cls.assertFalse(thiscontext.flags[sig])
|
cls.assertFalse(thiscontext.flags[sig])
|
||||||
return
|
|
||||||
|
|
||||||
class ThreadingTest(unittest.TestCase):
|
class ThreadingTest(unittest.TestCase):
|
||||||
'''Unit tests for thread local contexts in Decimal.'''
|
'''Unit tests for thread local contexts in Decimal.'''
|
||||||
|
@ -1602,7 +1601,6 @@ class ThreadingTest(unittest.TestCase):
|
||||||
DefaultContext.prec = save_prec
|
DefaultContext.prec = save_prec
|
||||||
DefaultContext.Emax = save_emax
|
DefaultContext.Emax = save_emax
|
||||||
DefaultContext.Emin = save_emin
|
DefaultContext.Emin = save_emin
|
||||||
return
|
|
||||||
|
|
||||||
@unittest.skipUnless(threading, 'threading required')
|
@unittest.skipUnless(threading, 'threading required')
|
||||||
class CThreadingTest(ThreadingTest):
|
class CThreadingTest(ThreadingTest):
|
||||||
|
@ -4525,7 +4523,6 @@ class PyWhitebox(unittest.TestCase):
|
||||||
self.assertEqual(d1._sign, b1._sign)
|
self.assertEqual(d1._sign, b1._sign)
|
||||||
self.assertEqual(d1._int, b1._int)
|
self.assertEqual(d1._int, b1._int)
|
||||||
self.assertEqual(d1._exp, b1._exp)
|
self.assertEqual(d1._exp, b1._exp)
|
||||||
return
|
|
||||||
|
|
||||||
Decimal(d1)
|
Decimal(d1)
|
||||||
self.assertEqual(d1._sign, b1._sign)
|
self.assertEqual(d1._sign, b1._sign)
|
||||||
|
@ -5271,7 +5268,7 @@ class CWhitebox(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
from locale import CHAR_MAX
|
from locale import CHAR_MAX
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
self.skipTest('locale.CHAR_MAX not available')
|
||||||
|
|
||||||
def make_grouping(lst):
|
def make_grouping(lst):
|
||||||
return ''.join([chr(x) for x in lst])
|
return ''.join([chr(x) for x in lst])
|
||||||
|
|
|
@ -217,16 +217,18 @@ class DisTests(unittest.TestCase):
|
||||||
def test_bug_708901(self):
|
def test_bug_708901(self):
|
||||||
self.do_disassembly_test(bug708901, dis_bug708901)
|
self.do_disassembly_test(bug708901, dis_bug708901)
|
||||||
|
|
||||||
|
# Test has been disabled due to change in the way
|
||||||
|
# list comps are handled. The byte code now includes
|
||||||
|
# a memory address and a file location, so they change from
|
||||||
|
# run to run.
|
||||||
|
@unittest.skip('disabled due to a change in the way list comps are handled')
|
||||||
def test_bug_1333982(self):
|
def test_bug_1333982(self):
|
||||||
# XXX: re-enable this test!
|
# XXX: re-enable this test!
|
||||||
# This one is checking bytecodes generated for an `assert` statement,
|
# This one is checking bytecodes generated for an `assert` statement,
|
||||||
# so fails if the tests are run with -O. Skip this test then.
|
# so fails if the tests are run with -O. Skip this test then.
|
||||||
pass # Test has been disabled due to change in the way
|
|
||||||
# list comps are handled. The byte code now includes
|
if __debug__:
|
||||||
# a memory address and a file location, so they change from
|
self.do_disassembly_test(bug1333982, dis_bug1333982)
|
||||||
# run to run.
|
|
||||||
# if __debug__:
|
|
||||||
# self.do_disassembly_test(bug1333982, dis_bug1333982)
|
|
||||||
|
|
||||||
def test_big_linenos(self):
|
def test_big_linenos(self):
|
||||||
def func(count):
|
def func(count):
|
||||||
|
|
|
@ -341,8 +341,7 @@ class OtherFileTests(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
fn = TESTFN.encode("ascii")
|
fn = TESTFN.encode("ascii")
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
# Skip test
|
self.skipTest('could not encode %r to ascii' % TESTFN)
|
||||||
return
|
|
||||||
f = _FileIO(fn, "w")
|
f = _FileIO(fn, "w")
|
||||||
try:
|
try:
|
||||||
f.write(b"abc")
|
f.write(b"abc")
|
||||||
|
|
|
@ -70,7 +70,7 @@ class GeneralFloatCases(unittest.TestCase):
|
||||||
# it still has to accept the normal python syntax
|
# it still has to accept the normal python syntax
|
||||||
import locale
|
import locale
|
||||||
if not locale.localeconv()['decimal_point'] == ',':
|
if not locale.localeconv()['decimal_point'] == ',':
|
||||||
return
|
self.skipTest('decimal_point is not ","')
|
||||||
|
|
||||||
self.assertEqual(float(" 3.14 "), 3.14)
|
self.assertEqual(float(" 3.14 "), 3.14)
|
||||||
self.assertEqual(float("+3.14 "), 3.14)
|
self.assertEqual(float("+3.14 "), 3.14)
|
||||||
|
|
|
@ -45,8 +45,6 @@ class TestPartial(unittest.TestCase):
|
||||||
self.assertEqual(p.args, (1, 2))
|
self.assertEqual(p.args, (1, 2))
|
||||||
self.assertEqual(p.keywords, dict(a=10, b=20))
|
self.assertEqual(p.keywords, dict(a=10, b=20))
|
||||||
# attributes should not be writable
|
# attributes should not be writable
|
||||||
if not isinstance(self.thetype, type):
|
|
||||||
return
|
|
||||||
self.assertRaises(AttributeError, setattr, p, 'func', map)
|
self.assertRaises(AttributeError, setattr, p, 'func', map)
|
||||||
self.assertRaises(AttributeError, setattr, p, 'args', (1, 2))
|
self.assertRaises(AttributeError, setattr, p, 'args', (1, 2))
|
||||||
self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2))
|
self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2))
|
||||||
|
@ -210,11 +208,13 @@ class TestPythonPartial(TestPartial):
|
||||||
thetype = PythonPartial
|
thetype = PythonPartial
|
||||||
|
|
||||||
# the python version hasn't a nice repr
|
# the python version hasn't a nice repr
|
||||||
def test_repr(self): pass
|
test_repr = None
|
||||||
|
|
||||||
# the python version isn't picklable
|
# the python version isn't picklable
|
||||||
def test_pickle(self): pass
|
test_pickle = test_setstate_refcount = None
|
||||||
def test_setstate_refcount(self): pass
|
|
||||||
|
# the python version isn't a type
|
||||||
|
test_attributes = None
|
||||||
|
|
||||||
class TestUpdateWrapper(unittest.TestCase):
|
class TestUpdateWrapper(unittest.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@ class GroupDatabaseTestCase(unittest.TestCase):
|
||||||
for e in entries:
|
for e in entries:
|
||||||
self.check_value(e)
|
self.check_value(e)
|
||||||
|
|
||||||
|
def test_values_extended(self):
|
||||||
|
entries = grp.getgrall()
|
||||||
if len(entries) > 1000: # Huge group file (NIS?) -- skip the rest
|
if len(entries) > 1000: # Huge group file (NIS?) -- skip the rest
|
||||||
return
|
self.skipTest('huge group file, extended test skipped')
|
||||||
|
|
||||||
for e in entries:
|
for e in entries:
|
||||||
e2 = grp.getgrgid(e.gr_gid)
|
e2 = grp.getgrgid(e.gr_gid)
|
||||||
|
|
|
@ -245,7 +245,7 @@ class ImportTests(unittest.TestCase):
|
||||||
if found[0] is not None:
|
if found[0] is not None:
|
||||||
found[0].close()
|
found[0].close()
|
||||||
if found[2][2] != imp.C_EXTENSION:
|
if found[2][2] != imp.C_EXTENSION:
|
||||||
return
|
self.skipTest("found module doesn't appear to be a C extension")
|
||||||
imp.load_module(name, None, *found[1:])
|
imp.load_module(name, None, *found[1:])
|
||||||
|
|
||||||
def test_multiple_calls_to_get_data(self):
|
def test_multiple_calls_to_get_data(self):
|
||||||
|
|
|
@ -421,14 +421,9 @@ class IOTest(unittest.TestCase):
|
||||||
# a long time to build the >2GB file and takes >2GB of disk space
|
# a long time to build the >2GB file and takes >2GB of disk space
|
||||||
# therefore the resource must be enabled to run this test.
|
# therefore the resource must be enabled to run this test.
|
||||||
if sys.platform[:3] == 'win' or sys.platform == 'darwin':
|
if sys.platform[:3] == 'win' or sys.platform == 'darwin':
|
||||||
if not support.is_resource_enabled("largefile"):
|
support.requires(
|
||||||
print("\nTesting large file ops skipped on %s." % sys.platform,
|
'largefile',
|
||||||
file=sys.stderr)
|
'test requires %s bytes and a long time to run' % self.LARGE)
|
||||||
print("It requires %d bytes and a long time." % self.LARGE,
|
|
||||||
file=sys.stderr)
|
|
||||||
print("Use 'regrtest.py -u largefile test_io' to run it.",
|
|
||||||
file=sys.stderr)
|
|
||||||
return
|
|
||||||
with self.open(support.TESTFN, "w+b", 0) as f:
|
with self.open(support.TESTFN, "w+b", 0) as f:
|
||||||
self.large_file_ops(f)
|
self.large_file_ops(f)
|
||||||
with self.open(support.TESTFN, "w+b") as f:
|
with self.open(support.TESTFN, "w+b") as f:
|
||||||
|
@ -698,6 +693,7 @@ class CommonBufferedTests:
|
||||||
|
|
||||||
self.assertEqual(42, bufio.fileno())
|
self.assertEqual(42, bufio.fileno())
|
||||||
|
|
||||||
|
@unittest.skip('test having existential crisis')
|
||||||
def test_no_fileno(self):
|
def test_no_fileno(self):
|
||||||
# XXX will we always have fileno() function? If so, kill
|
# XXX will we always have fileno() function? If so, kill
|
||||||
# this test. Else, write it.
|
# this test. Else, write it.
|
||||||
|
|
|
@ -57,7 +57,7 @@ class AbstractMemoryTests:
|
||||||
|
|
||||||
def test_setitem_readonly(self):
|
def test_setitem_readonly(self):
|
||||||
if not self.ro_type:
|
if not self.ro_type:
|
||||||
return
|
self.skipTest("no read-only type to test")
|
||||||
b = self.ro_type(self._source)
|
b = self.ro_type(self._source)
|
||||||
oldrefcount = sys.getrefcount(b)
|
oldrefcount = sys.getrefcount(b)
|
||||||
m = self._view(b)
|
m = self._view(b)
|
||||||
|
@ -71,7 +71,7 @@ class AbstractMemoryTests:
|
||||||
|
|
||||||
def test_setitem_writable(self):
|
def test_setitem_writable(self):
|
||||||
if not self.rw_type:
|
if not self.rw_type:
|
||||||
return
|
self.skipTest("no writable type to test")
|
||||||
tp = self.rw_type
|
tp = self.rw_type
|
||||||
b = self.rw_type(self._source)
|
b = self.rw_type(self._source)
|
||||||
oldrefcount = sys.getrefcount(b)
|
oldrefcount = sys.getrefcount(b)
|
||||||
|
@ -189,13 +189,13 @@ class AbstractMemoryTests:
|
||||||
|
|
||||||
def test_attributes_readonly(self):
|
def test_attributes_readonly(self):
|
||||||
if not self.ro_type:
|
if not self.ro_type:
|
||||||
return
|
self.skipTest("no read-only type to test")
|
||||||
m = self.check_attributes_with_type(self.ro_type)
|
m = self.check_attributes_with_type(self.ro_type)
|
||||||
self.assertEqual(m.readonly, True)
|
self.assertEqual(m.readonly, True)
|
||||||
|
|
||||||
def test_attributes_writable(self):
|
def test_attributes_writable(self):
|
||||||
if not self.rw_type:
|
if not self.rw_type:
|
||||||
return
|
self.skipTest("no writable type to test")
|
||||||
m = self.check_attributes_with_type(self.rw_type)
|
m = self.check_attributes_with_type(self.rw_type)
|
||||||
self.assertEqual(m.readonly, False)
|
self.assertEqual(m.readonly, False)
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ class AbstractMemoryTests:
|
||||||
# buffer as writable causing a segfault if using mmap
|
# buffer as writable causing a segfault if using mmap
|
||||||
tp = self.ro_type
|
tp = self.ro_type
|
||||||
if tp is None:
|
if tp is None:
|
||||||
return
|
self.skipTest("no read-only type to test")
|
||||||
b = tp(self._source)
|
b = tp(self._source)
|
||||||
m = self._view(b)
|
m = self._view(b)
|
||||||
i = io.BytesIO(b'ZZZZ')
|
i = io.BytesIO(b'ZZZZ')
|
||||||
|
@ -370,12 +370,12 @@ class BaseArrayMemoryTests(AbstractMemoryTests):
|
||||||
itemsize = array.array('i').itemsize
|
itemsize = array.array('i').itemsize
|
||||||
format = 'i'
|
format = 'i'
|
||||||
|
|
||||||
|
@unittest.skip('XXX test should be adapted for non-byte buffers')
|
||||||
def test_getbuffer(self):
|
def test_getbuffer(self):
|
||||||
# XXX Test should be adapted for non-byte buffers
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@unittest.skip('XXX NotImplementedError: tolist() only supports byte views')
|
||||||
def test_tolist(self):
|
def test_tolist(self):
|
||||||
# XXX NotImplementedError: tolist() only supports byte views
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ class _TestProcess(BaseTestCase):
|
||||||
|
|
||||||
def test_current(self):
|
def test_current(self):
|
||||||
if self.TYPE == 'threads':
|
if self.TYPE == 'threads':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
current = self.current_process()
|
current = self.current_process()
|
||||||
authkey = current.authkey
|
authkey = current.authkey
|
||||||
|
@ -209,7 +209,7 @@ class _TestProcess(BaseTestCase):
|
||||||
|
|
||||||
def test_daemon_argument(self):
|
def test_daemon_argument(self):
|
||||||
if self.TYPE == "threads":
|
if self.TYPE == "threads":
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
# By default uses the current process's daemon flag.
|
# By default uses the current process's daemon flag.
|
||||||
proc0 = self.Process(target=self._test)
|
proc0 = self.Process(target=self._test)
|
||||||
|
@ -274,7 +274,7 @@ class _TestProcess(BaseTestCase):
|
||||||
|
|
||||||
def test_terminate(self):
|
def test_terminate(self):
|
||||||
if self.TYPE == 'threads':
|
if self.TYPE == 'threads':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
p = self.Process(target=self._test_terminate)
|
p = self.Process(target=self._test_terminate)
|
||||||
p.daemon = True
|
p.daemon = True
|
||||||
|
@ -378,7 +378,7 @@ class _TestProcess(BaseTestCase):
|
||||||
|
|
||||||
def test_sentinel(self):
|
def test_sentinel(self):
|
||||||
if self.TYPE == "threads":
|
if self.TYPE == "threads":
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
event = self.Event()
|
event = self.Event()
|
||||||
p = self.Process(target=self._test_sentinel, args=(event,))
|
p = self.Process(target=self._test_sentinel, args=(event,))
|
||||||
with self.assertRaises(ValueError):
|
with self.assertRaises(ValueError):
|
||||||
|
@ -434,7 +434,7 @@ class _TestSubclassingProcess(BaseTestCase):
|
||||||
def test_stderr_flush(self):
|
def test_stderr_flush(self):
|
||||||
# sys.stderr is flushed at process shutdown (issue #13812)
|
# sys.stderr is flushed at process shutdown (issue #13812)
|
||||||
if self.TYPE == "threads":
|
if self.TYPE == "threads":
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
testfn = test.support.TESTFN
|
testfn = test.support.TESTFN
|
||||||
self.addCleanup(test.support.unlink, testfn)
|
self.addCleanup(test.support.unlink, testfn)
|
||||||
|
@ -462,7 +462,7 @@ class _TestSubclassingProcess(BaseTestCase):
|
||||||
def test_sys_exit(self):
|
def test_sys_exit(self):
|
||||||
# See Issue 13854
|
# See Issue 13854
|
||||||
if self.TYPE == 'threads':
|
if self.TYPE == 'threads':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
testfn = test.support.TESTFN
|
testfn = test.support.TESTFN
|
||||||
self.addCleanup(test.support.unlink, testfn)
|
self.addCleanup(test.support.unlink, testfn)
|
||||||
|
@ -671,7 +671,7 @@ class _TestQueue(BaseTestCase):
|
||||||
try:
|
try:
|
||||||
self.assertEqual(q.qsize(), 0)
|
self.assertEqual(q.qsize(), 0)
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
return
|
self.skipTest('qsize method not implemented')
|
||||||
q.put(1)
|
q.put(1)
|
||||||
self.assertEqual(q.qsize(), 1)
|
self.assertEqual(q.qsize(), 1)
|
||||||
q.put(5)
|
q.put(5)
|
||||||
|
@ -779,7 +779,7 @@ class _TestSemaphore(BaseTestCase):
|
||||||
|
|
||||||
def test_timeout(self):
|
def test_timeout(self):
|
||||||
if self.TYPE != 'processes':
|
if self.TYPE != 'processes':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
sem = self.Semaphore(0)
|
sem = self.Semaphore(0)
|
||||||
acquire = TimingWrapper(sem.acquire)
|
acquire = TimingWrapper(sem.acquire)
|
||||||
|
@ -1399,7 +1399,7 @@ class _TestBarrier(BaseTestCase):
|
||||||
|
|
||||||
def test_thousand(self):
|
def test_thousand(self):
|
||||||
if self.TYPE == 'manager':
|
if self.TYPE == 'manager':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
passes = 1000
|
passes = 1000
|
||||||
lock = self.Lock()
|
lock = self.Lock()
|
||||||
conn, child_conn = self.Pipe(False)
|
conn, child_conn = self.Pipe(False)
|
||||||
|
@ -1694,7 +1694,7 @@ class _TestPool(BaseTestCase):
|
||||||
def test_map_unplicklable(self):
|
def test_map_unplicklable(self):
|
||||||
# Issue #19425 -- failure to pickle should not cause a hang
|
# Issue #19425 -- failure to pickle should not cause a hang
|
||||||
if self.TYPE == 'threads':
|
if self.TYPE == 'threads':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
class A(object):
|
class A(object):
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
raise RuntimeError('cannot pickle')
|
raise RuntimeError('cannot pickle')
|
||||||
|
@ -2188,7 +2188,7 @@ class _TestConnection(BaseTestCase):
|
||||||
|
|
||||||
def test_sendbytes(self):
|
def test_sendbytes(self):
|
||||||
if self.TYPE != 'processes':
|
if self.TYPE != 'processes':
|
||||||
return
|
self.skipTest('test not appropriate for {}'.format(self.TYPE))
|
||||||
|
|
||||||
msg = latin('abcdefghijklmnopqrstuvwxyz')
|
msg = latin('abcdefghijklmnopqrstuvwxyz')
|
||||||
a, b = self.Pipe()
|
a, b = self.Pipe()
|
||||||
|
|
|
@ -12,11 +12,7 @@ class NisTests(unittest.TestCase):
|
||||||
maps = nis.maps()
|
maps = nis.maps()
|
||||||
except nis.error as msg:
|
except nis.error as msg:
|
||||||
# NIS is probably not active, so this test isn't useful
|
# NIS is probably not active, so this test isn't useful
|
||||||
if support.verbose:
|
self.skipTest(str(msg))
|
||||||
print("Test Skipped:", msg)
|
|
||||||
# Can't raise SkipTest as regrtest only recognizes the exception
|
|
||||||
# import time.
|
|
||||||
return
|
|
||||||
try:
|
try:
|
||||||
# On some systems, this map is only accessible to the
|
# On some systems, this map is only accessible to the
|
||||||
# super user
|
# super user
|
||||||
|
|
|
@ -218,7 +218,7 @@ class TestNtpath(unittest.TestCase):
|
||||||
import nt
|
import nt
|
||||||
tester('ntpath.abspath("C:\\")', "C:\\")
|
tester('ntpath.abspath("C:\\")', "C:\\")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
self.skipTest('nt module not available')
|
||||||
|
|
||||||
def test_relpath(self):
|
def test_relpath(self):
|
||||||
currentdir = os.path.split(os.getcwd())[-1]
|
currentdir = os.path.split(os.getcwd())[-1]
|
||||||
|
|
|
@ -263,7 +263,7 @@ class StatAttributeTests(unittest.TestCase):
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
# On AtheOS, glibc always returns ENOSYS
|
# On AtheOS, glibc always returns ENOSYS
|
||||||
if e.errno == errno.ENOSYS:
|
if e.errno == errno.ENOSYS:
|
||||||
return
|
self.skipTest('glibc always returns ENOSYS on AtheOS')
|
||||||
|
|
||||||
# Make sure direct access works
|
# Make sure direct access works
|
||||||
self.assertEqual(result.f_bfree, result[3])
|
self.assertEqual(result.f_bfree, result[3])
|
||||||
|
@ -480,7 +480,7 @@ class StatAttributeTests(unittest.TestCase):
|
||||||
os.stat(r"c:\pagefile.sys")
|
os.stat(r"c:\pagefile.sys")
|
||||||
except WindowsError as e:
|
except WindowsError as e:
|
||||||
if e.errno == 2: # file does not exist; cannot run test
|
if e.errno == 2: # file does not exist; cannot run test
|
||||||
return
|
self.skipTest(r'c:\pagefile.sys does not exist')
|
||||||
self.fail("Could not stat pagefile.sys")
|
self.fail("Could not stat pagefile.sys")
|
||||||
|
|
||||||
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
|
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
|
||||||
|
|
|
@ -8,8 +8,6 @@ class PwdTest(unittest.TestCase):
|
||||||
|
|
||||||
def test_values(self):
|
def test_values(self):
|
||||||
entries = pwd.getpwall()
|
entries = pwd.getpwall()
|
||||||
entriesbyname = {}
|
|
||||||
entriesbyuid = {}
|
|
||||||
|
|
||||||
for e in entries:
|
for e in entries:
|
||||||
self.assertEqual(len(e), 7)
|
self.assertEqual(len(e), 7)
|
||||||
|
@ -32,13 +30,20 @@ class PwdTest(unittest.TestCase):
|
||||||
# for one uid
|
# for one uid
|
||||||
# self.assertEqual(pwd.getpwuid(e.pw_uid), e)
|
# self.assertEqual(pwd.getpwuid(e.pw_uid), e)
|
||||||
# instead of this collect all entries for one uid
|
# instead of this collect all entries for one uid
|
||||||
# and check afterwards
|
# and check afterwards (done in test_values_extended)
|
||||||
|
|
||||||
|
def test_values_extended(self):
|
||||||
|
entries = pwd.getpwall()
|
||||||
|
entriesbyname = {}
|
||||||
|
entriesbyuid = {}
|
||||||
|
|
||||||
|
if len(entries) > 1000: # Huge passwd file (NIS?) -- skip this test
|
||||||
|
self.skipTest('passwd file is huge; extended test skipped')
|
||||||
|
|
||||||
|
for e in entries:
|
||||||
entriesbyname.setdefault(e.pw_name, []).append(e)
|
entriesbyname.setdefault(e.pw_name, []).append(e)
|
||||||
entriesbyuid.setdefault(e.pw_uid, []).append(e)
|
entriesbyuid.setdefault(e.pw_uid, []).append(e)
|
||||||
|
|
||||||
if len(entries) > 1000: # Huge passwd file (NIS?) -- skip the rest
|
|
||||||
return
|
|
||||||
|
|
||||||
# check whether the entry returned by getpwuid()
|
# check whether the entry returned by getpwuid()
|
||||||
# for each uid is among those from getpwall() for this uid
|
# for each uid is among those from getpwall() for this uid
|
||||||
for e in entries:
|
for e in entries:
|
||||||
|
|
|
@ -166,6 +166,7 @@ class ReprTests(unittest.TestCase):
|
||||||
eq(r([[[[[[{}]]]]]]), "[[[[[[{}]]]]]]")
|
eq(r([[[[[[{}]]]]]]), "[[[[[[{}]]]]]]")
|
||||||
eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]")
|
eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]")
|
||||||
|
|
||||||
|
@unittest.skip('hard to catch a cell object')
|
||||||
def test_cell(self):
|
def test_cell(self):
|
||||||
# XXX Hmm? How to get at a cell object?
|
# XXX Hmm? How to get at a cell object?
|
||||||
pass
|
pass
|
||||||
|
@ -272,6 +273,7 @@ class foo(object):
|
||||||
eq(repr(foo.foo),
|
eq(repr(foo.foo),
|
||||||
"<class '%s.foo'>" % foo.__name__)
|
"<class '%s.foo'>" % foo.__name__)
|
||||||
|
|
||||||
|
@unittest.skip('need a suitable object')
|
||||||
def test_object(self):
|
def test_object(self):
|
||||||
# XXX Test the repr of a type with a really long tp_name but with no
|
# XXX Test the repr of a type with a really long tp_name but with no
|
||||||
# tp_repr. WIBNI we had ::Inline? :)
|
# tp_repr. WIBNI we had ::Inline? :)
|
||||||
|
@ -319,6 +321,7 @@ class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
'<bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <%s.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa object at 0x' \
|
'<bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <%s.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa object at 0x' \
|
||||||
% (qux.__name__,) ), r)
|
% (qux.__name__,) ), r)
|
||||||
|
|
||||||
|
@unittest.skip('needs a built-in function with a really long name')
|
||||||
def test_builtin_function(self):
|
def test_builtin_function(self):
|
||||||
# XXX test built-in functions and methods with really long names
|
# XXX test built-in functions and methods with really long names
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -752,11 +752,9 @@ class TestShutil(unittest.TestCase):
|
||||||
self.assertEquals(os.stat(restrictive_subdir).st_mode,
|
self.assertEquals(os.stat(restrictive_subdir).st_mode,
|
||||||
os.stat(restrictive_subdir_dst).st_mode)
|
os.stat(restrictive_subdir_dst).st_mode)
|
||||||
|
|
||||||
|
@unittest.skipIf(os.name == 'nt', 'temporarily disabled on Windows')
|
||||||
@unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
|
@unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
|
||||||
def test_dont_copy_file_onto_link_to_itself(self):
|
def test_dont_copy_file_onto_link_to_itself(self):
|
||||||
# Temporarily disable test on Windows.
|
|
||||||
if os.name == 'nt':
|
|
||||||
return
|
|
||||||
# bug 851123.
|
# bug 851123.
|
||||||
os.mkdir(TESTFN)
|
os.mkdir(TESTFN)
|
||||||
src = os.path.join(TESTFN, 'cheese')
|
src = os.path.join(TESTFN, 'cheese')
|
||||||
|
|
|
@ -374,6 +374,7 @@ class ImportSideEffectTests(unittest.TestCase):
|
||||||
self.assertNotIn(path, seen_paths)
|
self.assertNotIn(path, seen_paths)
|
||||||
seen_paths.add(path)
|
seen_paths.add(path)
|
||||||
|
|
||||||
|
@unittest.skip('test not implemented')
|
||||||
def test_add_build_dir(self):
|
def test_add_build_dir(self):
|
||||||
# Test that the build directory's Modules directory is used when it
|
# Test that the build directory's Modules directory is used when it
|
||||||
# should be.
|
# should be.
|
||||||
|
|
|
@ -714,13 +714,13 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
ip = socket.gethostbyname(hostname)
|
ip = socket.gethostbyname(hostname)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
# Probably name lookup wasn't set up right; skip this test
|
# Probably name lookup wasn't set up right; skip this test
|
||||||
return
|
self.skipTest('name lookup failure')
|
||||||
self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.")
|
self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.")
|
||||||
try:
|
try:
|
||||||
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
|
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
# Probably a similar problem as above; skip this test
|
# Probably a similar problem as above; skip this test
|
||||||
return
|
self.skipTest('name lookup failure')
|
||||||
all_host_names = [hostname, hname] + aliases
|
all_host_names = [hostname, hname] + aliases
|
||||||
fqhn = socket.getfqdn(ip)
|
fqhn = socket.getfqdn(ip)
|
||||||
if not fqhn in all_host_names:
|
if not fqhn in all_host_names:
|
||||||
|
@ -932,9 +932,9 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
from socket import inet_pton, AF_INET6, has_ipv6
|
from socket import inet_pton, AF_INET6, has_ipv6
|
||||||
if not has_ipv6:
|
if not has_ipv6:
|
||||||
return
|
self.skipTest('IPv6 not available')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
self.skipTest('could not import needed symbols from socket')
|
||||||
f = lambda a: inet_pton(AF_INET6, a)
|
f = lambda a: inet_pton(AF_INET6, a)
|
||||||
assertInvalid = lambda a: self.assertRaises(
|
assertInvalid = lambda a: self.assertRaises(
|
||||||
(socket.error, ValueError), f, a
|
(socket.error, ValueError), f, a
|
||||||
|
@ -1010,9 +1010,9 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
from socket import inet_ntop, AF_INET6, has_ipv6
|
from socket import inet_ntop, AF_INET6, has_ipv6
|
||||||
if not has_ipv6:
|
if not has_ipv6:
|
||||||
return
|
self.skipTest('IPv6 not available')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return
|
self.skipTest('could not import needed symbols from socket')
|
||||||
f = lambda a: inet_ntop(AF_INET6, a)
|
f = lambda a: inet_ntop(AF_INET6, a)
|
||||||
assertInvalid = lambda a: self.assertRaises(
|
assertInvalid = lambda a: self.assertRaises(
|
||||||
(socket.error, ValueError), f, a
|
(socket.error, ValueError), f, a
|
||||||
|
@ -1045,7 +1045,7 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
my_ip_addr = socket.gethostbyname(socket.gethostname())
|
my_ip_addr = socket.gethostbyname(socket.gethostname())
|
||||||
except socket.error:
|
except socket.error:
|
||||||
# Probably name lookup wasn't set up right; skip this test
|
# Probably name lookup wasn't set up right; skip this test
|
||||||
return
|
self.skipTest('name lookup failure')
|
||||||
self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
|
self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
|
||||||
self.assertEqual(name[1], port)
|
self.assertEqual(name[1], port)
|
||||||
|
|
||||||
|
|
|
@ -323,7 +323,7 @@ class StrptimeTests(unittest.TestCase):
|
||||||
# when time.tzname[0] == time.tzname[1] and time.daylight
|
# when time.tzname[0] == time.tzname[1] and time.daylight
|
||||||
tz_name = time.tzname[0]
|
tz_name = time.tzname[0]
|
||||||
if tz_name.upper() in ("UTC", "GMT"):
|
if tz_name.upper() in ("UTC", "GMT"):
|
||||||
return
|
self.skipTest('need non-UTC/GMT timezone')
|
||||||
try:
|
try:
|
||||||
original_tzname = time.tzname
|
original_tzname = time.tzname
|
||||||
original_daylight = time.daylight
|
original_daylight = time.daylight
|
||||||
|
@ -536,7 +536,7 @@ class CacheTests(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
locale.setlocale(locale.LC_TIME, ('en_US', 'UTF8'))
|
locale.setlocale(locale.LC_TIME, ('en_US', 'UTF8'))
|
||||||
except locale.Error:
|
except locale.Error:
|
||||||
return
|
self.skipTest('test needs en_US.UTF8 locale')
|
||||||
try:
|
try:
|
||||||
_strptime._strptime_time('10', '%d')
|
_strptime._strptime_time('10', '%d')
|
||||||
# Get id of current cache object.
|
# Get id of current cache object.
|
||||||
|
@ -553,7 +553,7 @@ class CacheTests(unittest.TestCase):
|
||||||
# If this is the case just suppress the exception and fall-through
|
# If this is the case just suppress the exception and fall-through
|
||||||
# to the resetting to the original locale.
|
# to the resetting to the original locale.
|
||||||
except locale.Error:
|
except locale.Error:
|
||||||
pass
|
self.skipTest('test needs de_DE.UTF8 locale')
|
||||||
# Make sure we don't trample on the locale setting once we leave the
|
# Make sure we don't trample on the locale setting once we leave the
|
||||||
# test.
|
# test.
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -324,10 +324,9 @@ class TestMkstempInner(BaseTestCase):
|
||||||
finally:
|
finally:
|
||||||
os.rmdir(dir)
|
os.rmdir(dir)
|
||||||
|
|
||||||
|
@unittest.skipUnless(has_stat, 'os.stat not available')
|
||||||
def test_file_mode(self):
|
def test_file_mode(self):
|
||||||
# _mkstemp_inner creates files with the proper mode
|
# _mkstemp_inner creates files with the proper mode
|
||||||
if not has_stat:
|
|
||||||
return # ugh, can't use SkipTest.
|
|
||||||
|
|
||||||
file = self.do_create()
|
file = self.do_create()
|
||||||
mode = stat.S_IMODE(os.stat(file.name).st_mode)
|
mode = stat.S_IMODE(os.stat(file.name).st_mode)
|
||||||
|
@ -339,10 +338,9 @@ class TestMkstempInner(BaseTestCase):
|
||||||
expected = user * (1 + 8 + 64)
|
expected = user * (1 + 8 + 64)
|
||||||
self.assertEqual(mode, expected)
|
self.assertEqual(mode, expected)
|
||||||
|
|
||||||
|
@unittest.skipUnless(has_spawnl, 'os.spawnl not available')
|
||||||
def test_noinherit(self):
|
def test_noinherit(self):
|
||||||
# _mkstemp_inner file handles are not inherited by child processes
|
# _mkstemp_inner file handles are not inherited by child processes
|
||||||
if not has_spawnl:
|
|
||||||
return # ugh, can't use SkipTest.
|
|
||||||
|
|
||||||
if support.verbose:
|
if support.verbose:
|
||||||
v="v"
|
v="v"
|
||||||
|
@ -377,10 +375,9 @@ class TestMkstempInner(BaseTestCase):
|
||||||
"child process caught fatal signal %d" % -retval)
|
"child process caught fatal signal %d" % -retval)
|
||||||
self.assertFalse(retval > 0, "child process reports failure %d"%retval)
|
self.assertFalse(retval > 0, "child process reports failure %d"%retval)
|
||||||
|
|
||||||
|
@unittest.skipUnless(has_textmode, "text mode not available")
|
||||||
def test_textmode(self):
|
def test_textmode(self):
|
||||||
# _mkstemp_inner can create files in text mode
|
# _mkstemp_inner can create files in text mode
|
||||||
if not has_textmode:
|
|
||||||
return # ugh, can't use SkipTest.
|
|
||||||
|
|
||||||
# A text file is truncated at the first Ctrl+Z byte
|
# A text file is truncated at the first Ctrl+Z byte
|
||||||
f = self.do_create(bin=0)
|
f = self.do_create(bin=0)
|
||||||
|
@ -556,10 +553,9 @@ class TestMkdtemp(BaseTestCase):
|
||||||
finally:
|
finally:
|
||||||
os.rmdir(dir)
|
os.rmdir(dir)
|
||||||
|
|
||||||
|
@unittest.skipUnless(has_stat, 'os.stat not available')
|
||||||
def test_mode(self):
|
def test_mode(self):
|
||||||
# mkdtemp creates directories with the proper mode
|
# mkdtemp creates directories with the proper mode
|
||||||
if not has_stat:
|
|
||||||
return # ugh, can't use SkipTest.
|
|
||||||
|
|
||||||
dir = self.do_create()
|
dir = self.do_create()
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -68,39 +68,35 @@ class ThreadRunningTests(BasicThreadTest):
|
||||||
thread.stack_size(0)
|
thread.stack_size(0)
|
||||||
self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
|
self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
|
||||||
|
|
||||||
if os.name not in ("nt", "os2", "posix"):
|
@unittest.skipIf(os.name not in ("nt", "os2", "posix"), 'test meant for nt, os2, and posix')
|
||||||
return
|
def test_nt_and_posix_stack_size(self):
|
||||||
|
|
||||||
tss_supported = True
|
|
||||||
try:
|
try:
|
||||||
thread.stack_size(4096)
|
thread.stack_size(4096)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
verbose_print("caught expected ValueError setting "
|
verbose_print("caught expected ValueError setting "
|
||||||
"stack_size(4096)")
|
"stack_size(4096)")
|
||||||
except thread.error:
|
except thread.error:
|
||||||
tss_supported = False
|
self.skipTest("platform does not support changing thread stack "
|
||||||
verbose_print("platform does not support changing thread stack "
|
"size")
|
||||||
"size")
|
|
||||||
|
|
||||||
if tss_supported:
|
fail_msg = "stack_size(%d) failed - should succeed"
|
||||||
fail_msg = "stack_size(%d) failed - should succeed"
|
for tss in (262144, 0x100000, 0):
|
||||||
for tss in (262144, 0x100000, 0):
|
thread.stack_size(tss)
|
||||||
thread.stack_size(tss)
|
self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
|
||||||
self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
|
verbose_print("successfully set stack_size(%d)" % tss)
|
||||||
verbose_print("successfully set stack_size(%d)" % tss)
|
|
||||||
|
|
||||||
for tss in (262144, 0x100000):
|
for tss in (262144, 0x100000):
|
||||||
verbose_print("trying stack_size = (%d)" % tss)
|
verbose_print("trying stack_size = (%d)" % tss)
|
||||||
self.next_ident = 0
|
self.next_ident = 0
|
||||||
self.created = 0
|
self.created = 0
|
||||||
for i in range(NUMTASKS):
|
for i in range(NUMTASKS):
|
||||||
self.newtask()
|
self.newtask()
|
||||||
|
|
||||||
verbose_print("waiting for all tasks to complete")
|
verbose_print("waiting for all tasks to complete")
|
||||||
self.done_mutex.acquire()
|
self.done_mutex.acquire()
|
||||||
verbose_print("all tasks done")
|
verbose_print("all tasks done")
|
||||||
|
|
||||||
thread.stack_size(0)
|
thread.stack_size(0)
|
||||||
|
|
||||||
def test__count(self):
|
def test__count(self):
|
||||||
# Test the _count() function.
|
# Test the _count() function.
|
||||||
|
|
|
@ -463,8 +463,7 @@ class TestLocale(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
tmp = locale.setlocale(locale.LC_ALL, "fr_FR")
|
tmp = locale.setlocale(locale.LC_ALL, "fr_FR")
|
||||||
except locale.Error:
|
except locale.Error:
|
||||||
# skip this test
|
self.skipTest('could not set locale.LC_ALL to fr_FR')
|
||||||
return
|
|
||||||
# This should not cause an exception
|
# This should not cause an exception
|
||||||
time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
|
time.strftime("%B", (2009,2,1,0,0,0,0,0,0))
|
||||||
|
|
||||||
|
|
|
@ -1952,12 +1952,12 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,)) # printable
|
self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,)) # printable
|
||||||
self.assertEqual(repr('\U00014000'), "'\\U00014000'") # nonprintable
|
self.assertEqual(repr('\U00014000'), "'\\U00014000'") # nonprintable
|
||||||
|
|
||||||
|
# This test only affects 32-bit platforms because expandtabs can only take
|
||||||
|
# an int as the max value, not a 64-bit C long. If expandtabs is changed
|
||||||
|
# to take a 64-bit long, this test should apply to all platforms.
|
||||||
|
@unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4,
|
||||||
|
'only applies to 32-bit platforms')
|
||||||
def test_expandtabs_overflows_gracefully(self):
|
def test_expandtabs_overflows_gracefully(self):
|
||||||
# This test only affects 32-bit platforms because expandtabs can only take
|
|
||||||
# an int as the max value, not a 64-bit C long. If expandtabs is changed
|
|
||||||
# to take a 64-bit long, this test should apply to all platforms.
|
|
||||||
if sys.maxsize > (1 << 32) or struct.calcsize('P') != 4:
|
|
||||||
return
|
|
||||||
self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize)
|
self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize)
|
||||||
|
|
||||||
@support.cpython_only
|
@support.cpython_only
|
||||||
|
|
|
@ -98,11 +98,10 @@ class urlopenNetworkTests(unittest.TestCase):
|
||||||
open_url.close()
|
open_url.close()
|
||||||
self.assertEqual(code, 404)
|
self.assertEqual(code, 404)
|
||||||
|
|
||||||
|
# On Windows, socket handles are not file descriptors; this
|
||||||
|
# test can't pass on Windows.
|
||||||
|
@unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows')
|
||||||
def test_fileno(self):
|
def test_fileno(self):
|
||||||
if sys.platform in ('win32',):
|
|
||||||
# On Windows, socket handles are not file descriptors; this
|
|
||||||
# test can't pass on Windows.
|
|
||||||
return
|
|
||||||
# Make sure fd returned by fileno is valid.
|
# Make sure fd returned by fileno is valid.
|
||||||
with self.urlopen("http://www.python.org/", timeout=None) as open_url:
|
with self.urlopen("http://www.python.org/", timeout=None) as open_url:
|
||||||
fd = open_url.fileno()
|
fd = open_url.fileno()
|
||||||
|
|
|
@ -682,7 +682,7 @@ class CatchWarningTests(BaseTest):
|
||||||
# Explicit tests for the test.support convenience wrapper
|
# Explicit tests for the test.support convenience wrapper
|
||||||
wmod = self.module
|
wmod = self.module
|
||||||
if wmod is not sys.modules['warnings']:
|
if wmod is not sys.modules['warnings']:
|
||||||
return
|
self.skipTest('module to test is not loaded warnings module')
|
||||||
with support.check_warnings(quiet=False) as w:
|
with support.check_warnings(quiet=False) as w:
|
||||||
self.assertEqual(w.warnings, [])
|
self.assertEqual(w.warnings, [])
|
||||||
wmod.simplefilter("always")
|
wmod.simplefilter("always")
|
||||||
|
|
|
@ -20,7 +20,6 @@ class CurrentTimeTest(unittest.TestCase):
|
||||||
t0 = server.currentTime.getCurrentTime()
|
t0 = server.currentTime.getCurrentTime()
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
self.skipTest("network error: %s" % e)
|
self.skipTest("network error: %s" % e)
|
||||||
return
|
|
||||||
|
|
||||||
# Perform a minimal sanity check on the result, just to be sure
|
# Perform a minimal sanity check on the result, just to be sure
|
||||||
# the request means what we think it means.
|
# the request means what we think it means.
|
||||||
|
@ -44,7 +43,6 @@ class CurrentTimeTest(unittest.TestCase):
|
||||||
builders = server.getAllBuilders()
|
builders = server.getAllBuilders()
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
self.skipTest("network error: %s" % e)
|
self.skipTest("network error: %s" % e)
|
||||||
return
|
|
||||||
self.addCleanup(lambda: server('close')())
|
self.addCleanup(lambda: server('close')())
|
||||||
|
|
||||||
# Perform a minimal sanity check on the result, just to be sure
|
# Perform a minimal sanity check on the result, just to be sure
|
||||||
|
|
|
@ -111,7 +111,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
|
||||||
# so we'll simply skip it then. Bug #765456.
|
# so we'll simply skip it then. Bug #765456.
|
||||||
#
|
#
|
||||||
if "zlib" in sys.builtin_module_names:
|
if "zlib" in sys.builtin_module_names:
|
||||||
return
|
self.skipTest('zlib is a builtin module')
|
||||||
if "zlib" in sys.modules:
|
if "zlib" in sys.modules:
|
||||||
del sys.modules["zlib"]
|
del sys.modules["zlib"]
|
||||||
files = {"zlib.py": (NOW, test_src)}
|
files = {"zlib.py": (NOW, test_src)}
|
||||||
|
|
|
@ -109,7 +109,7 @@ Tests
|
||||||
import, converting from test_main to unittest.main, and running the
|
import, converting from test_main to unittest.main, and running the
|
||||||
_testcapi module tests within a unittest TestCase.
|
_testcapi module tests within a unittest TestCase.
|
||||||
|
|
||||||
- Issue #18702: All skipped tests now reported as skipped.
|
- Issue #18702, 19572: All skipped tests now reported as skipped.
|
||||||
|
|
||||||
- Issue #19085: Added basic tests for all tkinter widget options.
|
- Issue #19085: Added basic tests for all tkinter widget options.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue