mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-02 23:18:44 +00:00
Test changes to Actually Portable Python (#240)
- Add missing `os.pipe` and `os.getuid` - Commented out _dummy_thread from Lib/threading.py so tests don't simulate multi-threading and waste time/error out - Revert test_hashlib to avoid blake2
This commit is contained in:
parent
a22f0736d8
commit
1aa0df696c
5 changed files with 20 additions and 3 deletions
|
@ -342,6 +342,7 @@ class Regrtest:
|
|||
and len(self.good) > 1):
|
||||
print("All", end=' ')
|
||||
print(count(len(self.good), "test"), "OK.")
|
||||
printlist(self.good)
|
||||
|
||||
if self.ns.print_slow:
|
||||
self.test_times.sort(reverse=True)
|
||||
|
|
5
third_party/python/Lib/test/test_code.py
vendored
5
third_party/python/Lib/test/test_code.py
vendored
|
@ -104,7 +104,10 @@ consts: ('None',)
|
|||
|
||||
import inspect
|
||||
import sys
|
||||
import threading
|
||||
try:
|
||||
import threading
|
||||
except ImportError as e:
|
||||
threading = None
|
||||
import unittest
|
||||
import weakref
|
||||
try:
|
||||
|
|
|
@ -10,7 +10,6 @@ import py_compile
|
|||
import random
|
||||
import stat
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import unittest
|
||||
import unittest.mock as mock
|
||||
|
@ -28,6 +27,10 @@ from test.support import (
|
|||
from test.support import script_helper
|
||||
from test.test_importlib.util import uncache
|
||||
|
||||
try:
|
||||
import threading
|
||||
except ImportError as e:
|
||||
threading = None
|
||||
|
||||
skip_if_dont_write_bytecode = unittest.skipIf(
|
||||
sys.dont_write_bytecode,
|
||||
|
@ -365,6 +368,7 @@ class ImportTests(unittest.TestCase):
|
|||
with self.assertRaises(AttributeError):
|
||||
os.does_not_exist
|
||||
|
||||
@unittest.skipUnless(threading != None, "concurrency requires threading")
|
||||
def test_concurrency(self):
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'data'))
|
||||
try:
|
||||
|
|
5
third_party/python/Lib/threading.py
vendored
5
third_party/python/Lib/threading.py
vendored
|
@ -1,7 +1,10 @@
|
|||
"""Thread module emulating a subset of Java's threading model."""
|
||||
|
||||
import sys as _sys
|
||||
import _dummy_thread as _thread
|
||||
import _thread
|
||||
# if you REALLY need threading for ensurepip or something
|
||||
# use _dummy_thread below instead of _thread
|
||||
# import _dummy_thread as _thread
|
||||
|
||||
from time import monotonic as _time
|
||||
from traceback import format_exc as _format_exc
|
||||
|
|
6
third_party/python/pyconfig.h
vendored
6
third_party/python/pyconfig.h
vendored
|
@ -446,6 +446,9 @@
|
|||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `getuid' function. */
|
||||
#define HAVE_GETUID 1
|
||||
|
||||
/* Define to 1 if you have the `getwd' function. */
|
||||
/* #undef HAVE_GETWD */
|
||||
|
||||
|
@ -654,6 +657,9 @@
|
|||
/* Define to 1 if you have the `pause' function. */
|
||||
#define HAVE_PAUSE 1
|
||||
|
||||
/* Define to 1 if you have the `pipe' function. */
|
||||
#define HAVE_PIPE 1
|
||||
|
||||
/* Define to 1 if you have the `pipe2' function. */
|
||||
#define HAVE_PIPE2 1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue