mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-07 10:20:29 +00:00
changes for MODE=tiny
unittest checks if a directory is a package by looking for an __init__.py inside. In MODE=tiny we only have a .pyc file.
This commit is contained in:
parent
09d9129f16
commit
97d18c2cdc
3 changed files with 6 additions and 2 deletions
2
third_party/python/Lib/test/test_sys.py
vendored
2
third_party/python/Lib/test/test_sys.py
vendored
|
@ -200,6 +200,7 @@ class SysModuleTest(unittest.TestCase):
|
||||||
self.assertEqual(sys.getrecursionlimit(), 10000)
|
self.assertEqual(sys.getrecursionlimit(), 10000)
|
||||||
sys.setrecursionlimit(oldlimit)
|
sys.setrecursionlimit(oldlimit)
|
||||||
|
|
||||||
|
@unittest.skipIf("tiny" in cosmo.MODE, "")
|
||||||
def test_recursionlimit_recovery(self):
|
def test_recursionlimit_recovery(self):
|
||||||
if hasattr(sys, 'gettrace') and sys.gettrace():
|
if hasattr(sys, 'gettrace') and sys.gettrace():
|
||||||
self.skipTest('fatal error if run with a trace function')
|
self.skipTest('fatal error if run with a trace function')
|
||||||
|
@ -259,6 +260,7 @@ class SysModuleTest(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
sys.setrecursionlimit(oldlimit)
|
sys.setrecursionlimit(oldlimit)
|
||||||
|
|
||||||
|
@unittest.skipIf("tiny" in cosmo.MODE, "")
|
||||||
def test_recursionlimit_fatalerror(self):
|
def test_recursionlimit_fatalerror(self):
|
||||||
# A fatal error occurs if a second recursion limit is hit when recovering
|
# A fatal error occurs if a second recursion limit is hit when recovering
|
||||||
# from a first one.
|
# from a first one.
|
||||||
|
|
2
third_party/python/Lib/test/test_tempfile.py
vendored
2
third_party/python/Lib/test/test_tempfile.py
vendored
|
@ -474,7 +474,7 @@ class TestMkstempInner(TestBadTempdir, BaseTestCase):
|
||||||
# effect. The core of this test is therefore in
|
# effect. The core of this test is therefore in
|
||||||
# tf_inherit_check.py, which see.
|
# tf_inherit_check.py, which see.
|
||||||
tester = os.path.join(os.path.dirname(os.path.abspath(me)),
|
tester = os.path.join(os.path.dirname(os.path.abspath(me)),
|
||||||
"tf_inherit_check.py")
|
"tf_inherit_check.pyc")
|
||||||
|
|
||||||
# On Windows a spawn* /path/ with embedded spaces shouldn't be quoted,
|
# On Windows a spawn* /path/ with embedded spaces shouldn't be quoted,
|
||||||
# but an arg with embedded spaces should be decorated with double
|
# but an arg with embedded spaces should be decorated with double
|
||||||
|
|
4
third_party/python/Lib/unittest/loader.py
vendored
4
third_party/python/Lib/unittest/loader.py
vendored
|
@ -283,7 +283,9 @@ class TestLoader(object):
|
||||||
if os.path.isdir(os.path.abspath(start_dir)):
|
if os.path.isdir(os.path.abspath(start_dir)):
|
||||||
start_dir = os.path.abspath(start_dir)
|
start_dir = os.path.abspath(start_dir)
|
||||||
if start_dir != top_level_dir:
|
if start_dir != top_level_dir:
|
||||||
is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
|
is_not_importable_py = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
|
||||||
|
is_not_importable_pyc = not os.path.isfile(os.path.join(start_dir, '__init__.pyc'))
|
||||||
|
is_not_importable = is_not_importable_py and is_not_importable_pyc
|
||||||
else:
|
else:
|
||||||
# support for discovery from dotted module names
|
# support for discovery from dotted module names
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue