Skip to content

Commit 88f48dd

Browse files
committed
Retire obsolete standard-library test adapters
Regenerate five test modules from CPython 3.15.0 with update_lib migrate, preserving existing markers. Restore normal doctest checking and native module imports now supported by RustPython. Keep the JSON recursion guards and remaining conditional markers unchanged. Assisted-by: Codex:version-unavailable
1 parent e68658a commit 88f48dd

5 files changed

Lines changed: 6 additions & 17 deletions

File tree

‎Lib/test/test_descrtut.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,7 @@ def m(self):
474474
"tut8": test_8}
475475

476476
def load_tests(loader, tests, pattern):
477-
from test.support.rustpython import DocTestChecker # TODO: RUSTPYTHON
478-
tests.addTest(doctest.DocTestSuite(checker=DocTestChecker())) # TODO: RUSTPYTHON
477+
tests.addTest(doctest.DocTestSuite())
479478
return tests
480479

481480

‎Lib/test/test_genexps.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@
277277
__test__ = {'doctests' : doctests}
278278

279279
def load_tests(loader, tests, pattern):
280-
from test.support.rustpython import DocTestChecker # TODO: RUSTPYTHON
281-
tests.addTest(doctest.DocTestSuite(checker=DocTestChecker())) # TODO: RUSTPYTHON
280+
tests.addTest(doctest.DocTestSuite())
282281
return tests
283282

284283

‎Lib/test/test_json/__init__.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99

1010
# import json with and without accelerations
11-
# XXX RUSTPYTHON: we don't import _json as fresh since the fresh module isn't placed
12-
# into the sys.modules cache, and therefore the vm can't recognize the _json.Scanner class
13-
cjson = import_helper.import_fresh_module('json') #, fresh=['_json'])
11+
cjson = import_helper.import_fresh_module('json', fresh=['_json'])
1412
pyjson = import_helper.import_fresh_module('json', blocked=['_json'])
1513
# JSONDecodeError is cached inside the _json module
1614
cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError

‎Lib/test/test_pstats.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
import os
1010
import pstats
1111
import tempfile
12-
try:
13-
import cProfile # XXX: RUSTPYTHON
14-
except ImportError:
15-
cProfile = None
12+
import cProfile
1613

1714
class LazyImportTest(unittest.TestCase):
1815
@support.cpython_only

‎Lib/test/test_types.py‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
import collections.abc
1111
from collections import namedtuple, UserDict, OrderedDict
1212
import copy
13-
# XXX: RUSTPYTHON
14-
try:
15-
import _datetime
16-
except ImportError:
17-
_datetime = None
13+
import _datetime
1814
import gc
1915
import inspect
2016
import pickle
@@ -25,9 +21,9 @@
2521
import unittest.mock
2622
import weakref
2723
import typing
24+
import re
2825

2926
import unittest # XXX: RUSTPYTHON; importing to be able to skip tests
30-
import re
3127

3228
c_types = import_fresh_module('types', fresh=['_types'])
3329
py_types = import_fresh_module('types', blocked=['_types'])

0 commit comments

Comments
 (0)