Skip to content
Prev Previous commit
Next Next commit
Add tests.
  • Loading branch information
ericsnowcurrently committed Mar 4, 2024
commit 46d1243d88c9131bd16b09190beacf5798b95761
5 changes: 5 additions & 0 deletions Lib/test/test__xxinterpchannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
channels = import_helper.import_module('_xxinterpchannels')


# Additional tests are found in Lib/test/test_interpreters/test_channels.py.
# New tests should be added there.
# XXX The tests here should be moved there. See the note under LowLevelTests.


##################################
# helpers

Expand Down
19 changes: 19 additions & 0 deletions Lib/test/test_interpreters/test_channels.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib
import threading
from textwrap import dedent
import unittest
Expand All @@ -11,6 +12,24 @@
from .utils import _run_output, TestBase


class LowLevelTests(TestBase):

# The behaviors in the low-level module is important in as much
# as it is exercised by the high-level module. Therefore the
# most # important testing happens in the high-level tests.
# These low-level tests cover corner cases that are not
# encountered by the high-level module, thus they
# mostly shouldn't matter as much.

# Additional tests are found in Lib/test/test__xxinterpchannels.py.
# XXX Those should be either moved to LowLevelTests or eliminated
# in favor of high-level tests in this file.

def test_highlevel_reloaded(self):
# See gh-115490 (https://github.com/python/cpython/issues/115490).
importlib.reload(channels)


class TestChannels(TestBase):

def test_create(self):
Expand Down
14 changes: 14 additions & 0 deletions Lib/test/test_interpreters/test_queues.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import importlib
import threading
from textwrap import dedent
import unittest
Expand All @@ -20,6 +21,19 @@ def tearDown(self):
pass


class LowLevelTests(TestBase):

# The behaviors in the low-level module is important in as much
# as it is exercised by the high-level module. Therefore the
# most # important testing happens in the high-level tests.
# These low-level tests cover corner cases that are not
# encountered by the high-level module, thus they
# mostly shouldn't matter as much.

def test_highlevel_reloaded(self):
importlib.reload(queues)


class QueueTests(TestBase):

def test_create(self):
Expand Down