Skip to content

Commit db327e7

Browse files
committed
Some test refactoring and improvements.
1 parent d762ed5 commit db327e7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/test/datetimetester.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,7 @@ def test_repr_subclass(self):
36523652
self.assertEqual(repr(td), "SubclassDatetime(2010, 10, 2, 0, 0, 3)")
36533653

36543654
@support.cpython_only
3655-
def test_concurrent_initialization(self):
3655+
def test_concurrent_initialization_subinterpreter(self):
36563656
# Run in a subprocess to ensure we get a clean version of _datetime
36573657
script = """if True:
36583658
from concurrent.futures import InterpreterPoolExecutor
@@ -3670,6 +3670,13 @@ def func():
36703670
self.assertEqual(out, b"a" * 8)
36713671
self.assertEqual(err, b"")
36723672

3673+
# Now test against concurrent reinitialization
3674+
script += "\nimport _datetime"
3675+
rc, out, err = script_helper.assert_python_ok("-c", script)
3676+
self.assertEqual(rc, 0)
3677+
self.assertEqual(out, b"a" * 8)
3678+
self.assertEqual(err, b"")
3679+
36733680

36743681
class TestSubclassDateTime(TestDateTime):
36753682
theclass = SubclassDatetime

0 commit comments

Comments
 (0)