Skip to content

Commit

Permalink
drop python3.4 and custom coverage combining
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Quast committed Dec 27, 2018
1 parent f2e390d commit 5befa2b
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 108 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ language: python
matrix:
fast_finish: true
include:
- python: 3.3
env: TOXENV=py33 COVERAGE_ID=travis-ci
- python: 3.4
env: TOXENV=py34 COVERAGE_ID=travis-ci
- python: 3.5
env: TOXENV=sa
- python: 3.5
env: TOXENV=py35,coveralls COVERAGE_ID=travis-ci
# some errors only present themselves when using with ASYNCIODEBUG,
# especially exceptions in tasks and so on.
- python: 3.5
env: ASYNCIODEBUG=1 TOXENV=py35 COVERAGE_ID=travis-ci
- python: 3.6
env: ASYNCIODEBUG=1 TOXENV=py35 COVERAGE_ID=travis-ci
- python: 3.7
env: ASYNCIODEBUG=1 TOXENV=py35 COVERAGE_ID=travis-ci

install:
- pip install tox
script:
Expand Down
1 change: 0 additions & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pytest-capturelog
pytest-asyncio
pytest-xdist
pytest-cov
Expand Down
4 changes: 2 additions & 2 deletions telnetlib3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def send_charset(self, offered):
if selected:
self.log.debug('encoding negotiated: {0}'.format(selected))
else:
self.log.warn('No suitable encoding offered by server: {!r}.'
.format(offered))
self.log.warning('No suitable encoding offered by server: {!r}.'
.format(offered))
return selected

def send_naws(self):
Expand Down
2 changes: 1 addition & 1 deletion telnetlib3/client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def data_received(self, data):
try:
recv_inband = self.writer.feed_byte(bytes([byte]))
except:
self._log_exception(self.log.warn, *sys.exc_info())
self._log_exception(self.log.warning, *sys.exc_info())
else:
if recv_inband:
# forward to reader (shell).
Expand Down
2 changes: 1 addition & 1 deletion telnetlib3/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def on_ttype(self, ttype):

elif (not ttype or self._ttype_count > self.TTYPE_LOOPMAX):
# empty reply string or too many responses!
self.log.warn('ttype cycle stop at {0}: {1}.'.format(key, ttype))
self.log.warning('ttype cycle stop at {0}: {1}.'.format(key, ttype))

elif (self._ttype_count == 3 and ttype.upper().startswith('MTTS ')):
val = self.get_extra_info('ttype2')
Expand Down
2 changes: 1 addition & 1 deletion telnetlib3/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def data_received(self, data):
try:
recv_inband = self.writer.feed_byte(bytes([byte]))
except:
self._log_exception(self.log.warn, *sys.exc_info())
self._log_exception(self.log.warning, *sys.exc_info())
else:
if recv_inband:
# forward to reader (shell).
Expand Down
34 changes: 17 additions & 17 deletions telnetlib3/stream_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def handle_xdisploc(self, xdisploc):
def handle_send_xdisploc(self):
"""Send XDISPLAY value ``xdisploc``, :rfc:`1096`."""
# xdisploc string format is '<host>:<dispnum>[.<screennum>]'.
self.log.warn('X Display requested, sending empty string.')
self.log.warning('X Display requested, sending empty string.')
return ''

def handle_sndloc(self, location):
Expand All @@ -1083,7 +1083,7 @@ def handle_sndloc(self, location):

def handle_send_sndloc(self):
"""Send LOCATION value ``location``, :rfc:`779`."""
self.log.warn('Location requested, sending empty response.')
self.log.warning('Location requested, sending empty response.')
return ''

def handle_ttype(self, ttype):
Expand All @@ -1098,7 +1098,7 @@ def handle_ttype(self, ttype):

def handle_send_ttype(self):
"""Send TTYPE value ``ttype``, :rfc:`1091`."""
self.log.warn('Terminal type requested, sending empty string.')
self.log.warning('Terminal type requested, sending empty string.')
return ''

def handle_naws(self, width, height):
Expand All @@ -1107,7 +1107,7 @@ def handle_naws(self, width, height):

def handle_send_naws(self):
"""Send window size ``width`` and ``height``, :rfc:`1073`."""
self.log.warn('Terminal size requested, sending 80x24.')
self.log.warning('Terminal size requested, sending 80x24.')
return 80, 24

def handle_environ(self, env):
Expand Down Expand Up @@ -1367,7 +1367,7 @@ def handle_will(self, opt):
# option value of -1 toggles opt.unsupported()
self.iac(DONT, opt)
self.remote_option[opt] = -1
self.log.warn('Unhandled: WILL {}.'.format(name_command(opt),))
self.log.warning('Unhandled: WILL {}.'.format(name_command(opt),))
self.local_option[opt] = -1
if self.pending_option.enabled(DO + opt):
self.pending_option[DO + opt] = False
Expand All @@ -1393,7 +1393,7 @@ def handle_wont(self, opt):
assert not (self.server), (
'cannot recv WONT LOGOUT on server end')
if not self.pending_option.enabled(DO + LOGOUT):
self.log.warn('Server sent WONT LOGOUT unsolicited')
self.log.warning('Server sent WONT LOGOUT unsolicited')
self._ext_callback[LOGOUT](WONT)
else:
self.remote_option[opt] = False
Expand Down Expand Up @@ -1507,7 +1507,7 @@ def _handle_sb_charset(self, buf):
.format(charset))
self._ext_callback[CHARSET](charset)
elif opt == REJECTED:
self.log.warn('recv IAC SB CHARSET REJECTED IAC SE')
self.log.warning('recv IAC SB CHARSET REJECTED IAC SE')
elif opt in (TTABLE_IS, TTABLE_ACK, TTABLE_NAK, TTABLE_REJECTED):
raise NotImplementedError('Translation table command received '
'but not supported: {!r}'.format(opt))
Expand Down Expand Up @@ -1657,8 +1657,8 @@ def _handle_sb_environ(self, buf):
# a pending option of value of 'False' means it was previously
# completed, subsequent environment values *should* have been
# sent as command INFO ...
self.log.warn('{} IS already recv; expected INFO.'
.format(name_command(cmd)))
self.log.warning('{} IS already recv; expected INFO.'
.format(name_command(cmd)))
if env:
self._ext_callback[cmd](env)
elif opt == SEND:
Expand Down Expand Up @@ -1910,11 +1910,11 @@ def _handle_sb_linemode_mode(self, mode):
# and the mode is different that what the current mode is,
# the client will ignore the new mode"
#
self.log.warn('server mode differs from local mode, '
'though ACK bit is set. Local mode will '
'remain.')
self.log.warn('!remote: {0!r}'.format(suggest_mode))
self.log.warn(' local: {0!r}'.format(self._linemode))
self.log.warning('server mode differs from local mode, '
'though ACK bit is set. Local mode will '
'remain.')
self.log.warning('!remote: {0!r}'.format(suggest_mode))
self.log.warning(' local: {0!r}'.format(self._linemode))
return

self.log.debug('Linemode matches, acknowledged by server.')
Expand Down Expand Up @@ -2024,8 +2024,8 @@ def _slc_process(self, func, slc_def):
"""
# out of bounds checking
if ord(func) > slc.NSLC:
self.log.warn('SLC not supported (out of range): ({!r})'
.format(func))
self.log.warning('SLC not supported (out of range): ({!r})'
.format(func))
self._slc_add(func, slc.SLC_nosupport())
return

Expand All @@ -2040,7 +2040,7 @@ def _slc_process(self, func, slc_def):
self.log.debug('_slc_process: client request SLC_VARIABLE')
self._slc_send()
else:
self.log.warn('func(0) flag expected, got {}.'.format(slc_def))
self.log.warning('func(0) flag expected, got {}.'.format(slc_def))
return

self.log.debug('_slc_process {:<9} mine={}, his={}'.format(
Expand Down
4 changes: 2 additions & 2 deletions telnetlib3/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ async def test_telnet_server_negotiation_fail(
host=bind_host, port=unused_tcp_port, loop=event_loop)

# exercise,
reader.readexactly(3) # IAC DO TTYPE, we ignore it!
await reader.readexactly(3) # IAC DO TTYPE, we ignore it!

# negotiation then times out, deferring to waiter_connected.
server = await asyncio.wait_for(_waiter_connected, 1.0)
Expand Down Expand Up @@ -552,7 +552,7 @@ async def test_telnet_client_tty_cmdline(bind_host, unused_tcp_port,
# this code may be reduced when pexpect asyncio is bugfixed ..
# we especially need pexpect to pass sys.stdin.isatty() test.
prog, args = 'telnetlib3-client', [
bind_host, str(unused_tcp_port), '--loglevel=warn',
bind_host, str(unused_tcp_port), '--loglevel=warning',
'--connect-minwait=0.05', '--connect-maxwait=0.05']

class HelloServer(asyncio.Protocol):
Expand Down
2 changes: 1 addition & 1 deletion telnetlib3/tests/test_naws.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def test_telnet_client_send_tty_naws(event_loop, bind_host,
_waiter = asyncio.Future()
given_cols, given_rows = 40, 20
prog, args = 'telnetlib3-client', [
bind_host, str(unused_tcp_port), '--loglevel=warn',
bind_host, str(unused_tcp_port), '--loglevel=warning',
'--connect-minwait=0.005', '--connect-maxwait=0.010']

# a server,
Expand Down
62 changes: 0 additions & 62 deletions tools/custom-combine.py

This file was deleted.

16 changes: 4 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = sa,py{33,34,35,36}, coverage, docs
envlist = py{35,36,37}, docs
skip_missing_interpreters = true

[testenv]
Expand All @@ -18,13 +18,9 @@ commands = {envbindir}/py.test \
--junit-xml=results.{envname}.xml \
--durations=10 \
} telnetlib3/tests
coverage combine
cp {toxinidir}/.coverage \
{toxinidir}/._coverage.{envname}.{env:COVERAGE_ID:local}
{toxinidir}/tools/custom-combine.py

[testenv:develop]
basepython = python3.6
basepython = python3.7
commands = {posargs:{envbindir}/py.test \
--looponfail \
--log-format='%(relativeCreated)2.2f %(filename)s:%(lineno)d %(message)s' \
Expand All @@ -38,11 +34,6 @@ commands = {posargs:{envbindir}/py.test \
--durations=1 \
telnetlib3/tests }

# combine & build html coverage report
[testenv:coverage]
basepython = python3.6
commands = {toxinidir}/tools/custom-combine.py

# report coverage to coveralls
[testenv:coveralls]
passenv = COVERALLS_REPO_TOKEN
Expand All @@ -51,6 +42,7 @@ commands = coveralls --verbose --rcfile={toxinidir}/.coveragerc

[testenv:sa]
# perform static analysis and style enforcement
# Disabled: needs to be brought up-to-date
basepython = python3.5
deps = -rrequirements-tests.txt
-rrequirements-analysis.txt
Expand All @@ -64,7 +56,7 @@ commands = python -m compileall -fq {toxinidir}/telnetlib3
[testenv:docs]
# build html documentation
whitelist_externals = echo
basepython = python3.6
basepython = python3.7
deps = -rrequirements-docs.txt
commands = {envbindir}/sphinx-build -E -v -n \
-d {toxinidir}/docs/_build/doctrees \
Expand Down

0 comments on commit 5befa2b

Please sign in to comment.