]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Reorder some test's decorators (GH-108804)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 3 Sep 2023 12:21:43 +0000 (15:21 +0300)
committerGitHub <noreply@github.com>
Sun, 3 Sep 2023 12:21:43 +0000 (15:21 +0300)
For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.

Lib/test/test_io.py
Lib/test/test_site.py

index 26ae40d93c84eb369a82be1a5a3286d16139050d..6976a64bf77e7d1f196a791c7fdb1b726af01a4a 100644 (file)
@@ -1541,8 +1541,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,
@@ -1930,8 +1930,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 9e701fd847acdf9fad35db944d3fd50169d195bf..20a96169e8be4eb5e09026e31b684578f15f4077 100644 (file)
@@ -465,10 +465,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.