8000 [3.11] Reorder some test's decorators (GH-108804) (GH-108845) · python/cpython@ba47d87 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba47d87

Browse files
[3.11] Reorder some test's decorators (GH-108804) (GH-108845)
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 b30c83e commit ba47d87

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

14601460
self.assertEqual(b"abcdefg", bufio.read())
14611461

1462-
@support.requires_resource('cpu')
14631462
@threading_helper.requires_working_threading()
1463+
@support.requires_resource('cpu')
14641464
def test_threads(self):
14651465
try:
14661466
# Write out many bytes with exactly the same number of 0's,
@@ -1834,8 +1834,8 @@ def test_truncate_after_write(self):
18341834
f.truncate()
18351835
self.assertEqual(f.tell(), buffer_size + 2)
18361836

1837-
@support.requires_resource('cpu')
18381837
@threading_helper.requires_working_threading()
1838+
@support.requires_resource('cpu')
18391839
def test_threads(self):
18401840
try:
18411841
# 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
@@ -466,10 +466,10 @@ def test_sitecustomize_executed(self):
466466
else:
467467
self.fail("sitecustomize not imported automatically")
468468

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

0 commit comments

Comments
 (0)
0