Skip to content

Commit 509bb61

Browse files
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.
1 parent 9c995ab commit 509bb61

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
@@ -1541,8 +1541,8 @@ def test_read_all(self):
15411541

15421542
self.assertEqual(b"abcdefg", bufio.read())
15431543

1544-
@support.requires_resource('cpu')
15451544
@threading_helper.requires_working_threading()
1545+
@support.requires_resource('cpu')
15461546
def test_threads(self):
15471547
try:
15481548
# Write out many bytes with exactly the same number of 0's,
@@ -1930,8 +1930,8 @@ def test_truncate_after_write(self):
19301930
f.truncate()
19311931
self.assertEqual(f.tell(), buffer_size + 2)
19321932

1933-
@support.requires_resource('cpu')
19341933
@threading_helper.requires_working_threading()
1934+
@support.requires_resource('cpu')
19351935
def test_threads(self):
19361936
try:
19371937
# 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)