bpo-46178: Remove/rename redundant Travis CI code (#30309) · python/cpython@2cf7d02

@@ -28,13 +28,6 @@ def wrapped(*args, **kwargs):

2828

return _retry_thrice(func, exc, *args, **kwargs)

2929

return wrapped

303031-

# bpo-35411: FTP tests of test_urllib2net randomly fail

32-

# with "425 Security: Bad IP connecting" on Travis CI

33-

skip_ftp_test_on_travis = unittest.skipIf('TRAVIS' in os.environ,

34-

'bpo-35411: skip FTP test '

35-

'on Travis CI')

36-37-3831

# Connecting to remote hosts is flaky. Make it more robust by retrying

3932

# the connection several times.

4033

_urlopen_with_retry = _wrap_with_retry_thrice(urllib.request.urlopen,

@@ -139,7 +132,6 @@ def setUp(self):

139132

# XXX The rest of these tests aren't very good -- they don't check much.

140133

# They do sometimes catch some major disasters, though.

141134142-

@skip_ftp_test_on_travis

143135

def test_ftp(self):

144136

urls = [

145137

'ftp://www.pythontest.net/README',

@@ -339,15 +331,13 @@ def test_http_timeout(self):

339331340332

FTP_HOST = 'ftp://www.pythontest.net/'

341333342-

@skip_ftp_test_on_travis

343334

def test_ftp_basic(self):

344335

self.assertIsNone(socket.getdefaulttimeout())

345336

with socket_helper.transient_internet(self.FTP_HOST, timeout=None):

346337

u = _urlopen_with_retry(self.FTP_HOST)

347338

self.addCleanup(u.close)

348339

self.assertIsNone(u.fp.fp.raw._sock.gettimeout())

349340350-

@skip_ftp_test_on_travis

351341

def test_ftp_default_timeout(self):

352342

self.assertIsNone(socket.getdefaulttimeout())

353343

with socket_helper.transient_internet(self.FTP_HOST):

@@ -359,7 +349,6 @@ def test_ftp_default_timeout(self):

359349

socket.setdefaulttimeout(None)

360350

self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)

361351362-

@skip_ftp_test_on_travis

363352

def test_ftp_no_timeout(self):

364353

self.assertIsNone(socket.getdefaulttimeout())

365354

with socket_helper.transient_internet(self.FTP_HOST):

@@ -371,7 +360,6 @@ def test_ftp_no_timeout(self):

371360

socket.setdefaulttimeout(None)

372361

self.assertIsNone(u.fp.fp.raw._sock.gettimeout())

373362374-

@skip_ftp_test_on_travis

375363

def test_ftp_timeout(self):

376364

with socket_helper.transient_internet(self.FTP_HOST):

377365

u = _urlopen_with_retry(self.FTP_HOST, timeout=60)