[3.12] Reorder some test's decorators (GH-108804) (#108844)

Reorder some test's decorators (GH-108804)

For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-09-04 04:47:07 -07:00 committed by GitHub
parent 183bb673a8
commit 7b936ac12e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1548,8 +1548,8 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
self.assertEqual(b"abcdefg", bufio.read()) self.assertEqual(b"abcdefg", bufio.read())
@support.requires_resource('cpu')
@threading_helper.requires_working_threading() @threading_helper.requires_working_threading()
@support.requires_resource('cpu')
def test_threads(self): def test_threads(self):
try: try:
# Write out many bytes with exactly the same number of 0's, # Write out many bytes with exactly the same number of 0's,
@ -1937,8 +1937,8 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
f.truncate() f.truncate()
self.assertEqual(f.tell(), buffer_size + 2) self.assertEqual(f.tell(), buffer_size + 2)
@support.requires_resource('cpu')
@threading_helper.requires_working_threading() @threading_helper.requires_working_threading()
@support.requires_resource('cpu')
def test_threads(self): def test_threads(self):
try: try:
# Write out many bytes from many threads and test they were # Write out many bytes from many threads and test they were

View file

@ -465,10 +465,10 @@ class ImportSideEffectTests(unittest.TestCase):
else: else:
self.fail("sitecustomize not imported automatically") self.fail("sitecustomize not imported automatically")
@test.support.requires_resource('network')
@test.support.system_must_validate_cert
@unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"), @unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"),
'need SSL support to download license') 'need SSL support to download license')
@test.support.requires_resource('network')
@test.support.system_must_validate_cert
def test_license_exists_at_url(self): def test_license_exists_at_url(self):
# This test is a bit fragile since it depends on the format of the # This test is a bit fragile since it depends on the format of the
# string displayed by license in the absence of a LICENSE file. # string displayed by license in the absence of a LICENSE file.