diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-09-04 04:47:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 13:47:07 +0200 |
commit | 7b936ac12e412e749b7b8bb918d9ea8111174ed7 (patch) | |
tree | 6dca97517176209c7590b3e6d35a0f160f7cdc74 | |
parent | [3.12] gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-10883... (diff) | |
download | cpython-7b936ac12e412e749b7b8bb918d9ea8111174ed7.tar.gz cpython-7b936ac12e412e749b7b8bb918d9ea8111174ed7.tar.bz2 cpython-7b936ac12e412e749b7b8bb918d9ea8111174ed7.zip |
[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 509bb61977cc8a4487efd3f9cdd63d9f7b86be62)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
-rw-r--r-- | Lib/test/test_io.py | 4 | ||||
-rw-r--r-- | Lib/test/test_site.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index cc16804fe21..fc56c1d5111 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1548,8 +1548,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, @@ -1937,8 +1937,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 diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9e701fd847a..20a96169e8b 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -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. |