mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-108416: Mark slow but not CPU bound test methods with requires_resource('walltime') (GH-108480)
This commit is contained in:
parent
f980cc19b9
commit
1e0d62793a
18 changed files with 48 additions and 3 deletions
|
@ -133,6 +133,7 @@ class OtherNetworkTests(unittest.TestCase):
|
|||
# XXX The rest of these tests aren't very good -- they don't check much.
|
||||
# They do sometimes catch some major disasters, though.
|
||||
|
||||
@support.requires_resource('walltime')
|
||||
def test_ftp(self):
|
||||
# Testing the same URL twice exercises the caching in CacheFTPHandler
|
||||
urls = [
|
||||
|
@ -196,6 +197,7 @@ class OtherNetworkTests(unittest.TestCase):
|
|||
self.assertEqual(res.geturl(),
|
||||
"http://www.pythontest.net/index.html#frag")
|
||||
|
||||
@support.requires_resource('walltime')
|
||||
def test_redirect_url_withfrag(self):
|
||||
redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/"
|
||||
with socket_helper.transient_internet(redirect_url_with_frag):
|
||||
|
@ -334,6 +336,7 @@ class TimeoutTest(unittest.TestCase):
|
|||
|
||||
FTP_HOST = 'ftp://www.pythontest.net/'
|
||||
|
||||
@support.requires_resource('walltime')
|
||||
def test_ftp_basic(self):
|
||||
self.assertIsNone(socket.getdefaulttimeout())
|
||||
with socket_helper.transient_internet(self.FTP_HOST, timeout=None):
|
||||
|
@ -352,6 +355,7 @@ class TimeoutTest(unittest.TestCase):
|
|||
socket.setdefaulttimeout(None)
|
||||
self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)
|
||||
|
||||
@support.requires_resource('walltime')
|
||||
def test_ftp_no_timeout(self):
|
||||
self.assertIsNone(socket.getdefaulttimeout())
|
||||
with socket_helper.transient_internet(self.FTP_HOST):
|
||||
|
@ -363,6 +367,7 @@ class TimeoutTest(unittest.TestCase):
|
|||
socket.setdefaulttimeout(None)
|
||||
self.assertIsNone(u.fp.fp.raw._sock.gettimeout())
|
||||
|
||||
@support.requires_resource('walltime')
|
||||
def test_ftp_timeout(self):
|
||||
with socket_helper.transient_internet(self.FTP_HOST):
|
||||
u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue