]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] Reorder some test's decorators (GH-108804) (GH-108845)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 3 Sep 2023 13:01:49 +0000 (06:01 -0700)
committerGitHub <noreply@github.com>
Sun, 3 Sep 2023 13:01:49 +0000 (13:01 +0000)
For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977cc8a4487efd3f9cdd63d9f7b86be62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_io.py
Lib/test/test_site.py

index 79aa2da58622b2c8791f767ea301a1c5ea780adc..0a5f82a8bed1140fa549f9f700c1e6b99505b79b 100644 (file)
@@ -1459,8 +1459,8 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
 
         self.assertEqual(b"abcdefg", bufio.read())
 
-    @support.requires_resource('cpu')
     @threading_helper.requires_working_threading()
+    @support.requires_resource('cpu')
     def test_threads(self):
         try:
             # Write out many bytes with exactly the same number of 0's,
@@ -1834,8 +1834,8 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
                 f.truncate()
                 self.assertEqual(f.tell(), buffer_size + 2)
 
-    @support.requires_resource('cpu')
     @threading_helper.requires_working_threading()
+    @support.requires_resource('cpu')
     def test_threads(self):
         try:
             # Write out many bytes from many threads and test they were
index b5dc381a2f3bba6fad4d87298ef7bc61fa2b027f..12a2b73a3fe2fb15ba51b8334ea9dbe632109894 100644 (file)
@@ -466,10 +466,10 @@ class ImportSideEffectTests(unittest.TestCase):
             else:
                 self.fail("sitecustomize not imported automatically")
 
-    @test.support.requires_resource('network')
-    @test.support.system_must_validate_cert
     @unittest.skipUnless(hasattr(urllib.request, "HTTPSHandler"),
                          'need SSL support to download license')
+    @test.support.requires_resource('network')
+    @test.support.system_must_validate_cert
     def test_license_exists_at_url(self):
         # 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.