mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
gh-116303: Skip test module dependent tests if test modules are unavailable (#117341)
This commit is contained in:
parent
2ec6bb4111
commit
ea94b3b149
57 changed files with 255 additions and 123 deletions
|
|
@ -11,6 +11,7 @@ import unittest
|
|||
import asyncio
|
||||
from test import support
|
||||
from test.support import requires_specialization, script_helper
|
||||
from test.support.import_helper import import_module
|
||||
|
||||
PAIR = (0,1)
|
||||
|
||||
|
|
@ -1829,15 +1830,15 @@ class TestRegressions(MonitoringTestBase, unittest.TestCase):
|
|||
class TestOptimizer(MonitoringTestBase, unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
import _testinternalcapi
|
||||
_testinternalcapi = import_module("_testinternalcapi")
|
||||
self.old_opt = _testinternalcapi.get_optimizer()
|
||||
opt = _testinternalcapi.new_counter_optimizer()
|
||||
_testinternalcapi.set_optimizer(opt)
|
||||
super(TestOptimizer, self).setUp()
|
||||
|
||||
def tearDown(self):
|
||||
import _testinternalcapi
|
||||
super(TestOptimizer, self).tearDown()
|
||||
import _testinternalcapi
|
||||
_testinternalcapi.set_optimizer(self.old_opt)
|
||||
|
||||
def test_for_loop(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue