Skip to content

Commit 7b936ac

Browse files
[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 509bb61) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 183bb67 commit 7b936ac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/test/test_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,8 +1548,8 @@ def test_read_all(self):
15481548

15491549
self.assertEqual(b"abcdefg", bufio.read())
15501550

1551-
@support.requires_resource('cpu')
15521551
@threading_helper.requires_working_threading()
1552+
@support.requires_resource('cpu')
15531553
def test_threads(self):
15541554
try:
15551555
# Write out many bytes with exactly the same number of 0's,
@@ -1937,8 +1937,8 @@ def test_truncate_after_write(self):
19371937
f.truncate()
19381938
self.assertEqual(f.tell(), buffer_size + 2)
19391939

1940-
@support.requires_resource('cpu')
19411940
@threading_helper.requires_working_threading()
1941+
@support.requires_resource('cpu')
19421942
def test_threads(self):
19431943
try:
19441944
# Write out many bytes from many threads and test they were

Lib/test/test_site.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ def test_sitecustomize_executed(self):
465465
else:
466466
self.fail("sitecustomize not imported automatically")
467467

468-
@test.support.requires_resource('network')
469-
@test.support.system_must_validate_cert
470468
@unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"),
471469
'need SSL support to download license')
470+
@test.support.requires_resource('network')
471+
@test.support.system_must_validate_cert
472472
def test_license_exists_at_url(self):
473473
# This test is a bit fragile since it depends on the format of the
474474
# string displayed by license in the absence of a LICENSE file.

0 commit comments

Comments
 (0)