Skip to content

Commit

Permalink
bpo-46178: Remove/rename redundant Travis CI code (python#30309)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Dec 31, 2021
1 parent 82c2b54 commit 2cf7d02
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/posix-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ steps:
COMMAND: make

- ${{ if eq(parameters.patchcheck, 'true') }}:
- script: ./python Tools/scripts/patchcheck.py --travis true
- script: ./python Tools/scripts/patchcheck.py --ci true
displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))

Expand Down
5 changes: 3 additions & 2 deletions Doc/library/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ test runner
a GUI tool for test discovery and execution. This is intended largely for ease of use
for those new to unit testing. For production environments it is
recommended that tests be driven by a continuous integration system such as
`Buildbot <https://buildbot.net/>`_, `Jenkins <https://jenkins.io/>`_
or `Travis-CI <https://travis-ci.com>`_, or `AppVeyor <https://www.appveyor.com/>`_.
`Buildbot <https://buildbot.net/>`_, `Jenkins <https://jenkins.io/>`_,
`GitHub Actions <https://github.com/features/actions>`_, or
`AppVeyor <https://www.appveyor.com/>`_.


.. _unittest-minimal-example:
Expand Down
12 changes: 0 additions & 12 deletions Lib/test/test_urllib2net.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ def wrapped(*args, **kwargs):
return _retry_thrice(func, exc, *args, **kwargs)
return wrapped

# bpo-35411: FTP tests of test_urllib2net randomly fail
# with "425 Security: Bad IP connecting" on Travis CI
skip_ftp_test_on_travis = unittest.skipIf('TRAVIS' in os.environ,
'bpo-35411: skip FTP test '
'on Travis CI')


# Connecting to remote hosts is flaky. Make it more robust by retrying
# the connection several times.
_urlopen_with_retry = _wrap_with_retry_thrice(urllib.request.urlopen,
Expand Down Expand Up @@ -139,7 +132,6 @@ def setUp(self):
# XXX The rest of these tests aren't very good -- they don't check much.
# They do sometimes catch some major disasters, though.

@skip_ftp_test_on_travis
def test_ftp(self):
urls = [
'ftp://www.pythontest.net/README',
Expand Down Expand Up @@ -339,15 +331,13 @@ def test_http_timeout(self):

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

@skip_ftp_test_on_travis
def test_ftp_basic(self):
self.assertIsNone(socket.getdefaulttimeout())
with socket_helper.transient_internet(self.FTP_HOST, timeout=None):
u = _urlopen_with_retry(self.FTP_HOST)
self.addCleanup(u.close)
self.assertIsNone(u.fp.fp.raw._sock.gettimeout())

@skip_ftp_test_on_travis
def test_ftp_default_timeout(self):
self.assertIsNone(socket.getdefaulttimeout())
with socket_helper.transient_internet(self.FTP_HOST):
Expand All @@ -359,7 +349,6 @@ def test_ftp_default_timeout(self):
socket.setdefaulttimeout(None)
self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60)

@skip_ftp_test_on_travis
def test_ftp_no_timeout(self):
self.assertIsNone(socket.getdefaulttimeout())
with socket_helper.transient_internet(self.FTP_HOST):
Expand All @@ -371,7 +360,6 @@ def test_ftp_no_timeout(self):
socket.setdefaulttimeout(None)
self.assertIsNone(u.fp.fp.raw._sock.gettimeout())

@skip_ftp_test_on_travis
def test_ftp_timeout(self):
with socket_helper.transient_internet(self.FTP_HOST):
u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
Expand Down
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
This is Python version 3.11.0 alpha 3
=====================================

.. image:: https://travis-ci.com/python/cpython.svg?branch=main
:alt: CPython build status on Travis CI
:target: https://travis-ci.com/python/cpython

.. image:: https://github.com/python/cpython/workflows/Tests/badge.svg
:alt: CPython build status on GitHub Actions
:target: https://github.com/python/cpython/actions
Expand Down
8 changes: 4 additions & 4 deletions Tools/scripts/patchcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def regenerated_pyconfig_h_in(file_paths):
else:
return "not needed"

def travis(pull_request):
def ci(pull_request):
if pull_request == 'false':
print('Not a pull request; skipping')
return
Expand Down Expand Up @@ -301,10 +301,10 @@ def main():
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--travis',
parser.add_argument('--ci',
help='Perform pass/fail checks')
args = parser.parse_args()
if args.travis:
travis(args.travis)
if args.ci:
ci(args.ci)
else:
main()

0 comments on commit 2cf7d02

Please sign in to comment.