Permalink
Browse files

update travis config file and try to add coveralls support

  • Loading branch information...
giampaolo committed Feb 25, 2016
1 parent f83053a commit d4800fd10a4a7f36d1160ee33899f5cec11c7590
Showing with 39 additions and 39 deletions.
  1. +13 −13 .ci/travis/install.sh
  2. +3 −2 .coveragerc
  3. +7 −6 .travis.yml
  4. +4 −0 README.rst
  5. +2 −1 appveyor.yml
  6. +2 −2 pyftpdlib/ioloop.py
  7. +1 −1 pyftpdlib/test/test_functional.py
  8. +7 −14 pyftpdlib/test/test_ioloop.py
View
@@ -14,24 +14,24 @@ if [[ "$(uname -s)" == 'Darwin' ]]; then
case "${PYVER}" in
py26)
pyenv install 2.6.9
pyenv virtualenv 2.6.9 pyftpdlib
pyenv install 2.6
pyenv virtualenv 2.6 psutil
;;
py27)
pyenv install 2.7.10
pyenv virtualenv 2.7.10 pyftpdlib
;;
py32)
pyenv install 3.2.6
pyenv virtualenv 3.2.6 pyftpdlib
pyenv install 2.7
pyenv virtualenv 2.7 psutil
;;
py33)
pyenv install 3.3.6
pyenv virtualenv 3.3.6 pyftpdlib
pyenv install 3.3
pyenv virtualenv 3.3 psutil
;;
py34)
pyenv install 3.4.3
pyenv virtualenv 3.4.3 pyftpdlib
pyenv install 3.4
pyenv virtualenv 3.4 psutil
;;
py35)
pyenv install 3.5
pyenv virtualenv 3.5 psutil
;;
esac
pyenv rehash
@@ -42,4 +42,4 @@ if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]] || [[ $PYVER == 'py26' ]]; then
pip install -U unittest2
fi
pip install -U pyopenssl pysendfile flake8 mock
pip install -U pyopenssl pysendfile flake8 mock coveralls
View
@@ -17,5 +17,6 @@ exclude_lines =
if hasattr(select, 'epoll'):
if hasattr(select, 'kqueue'):
if PY3:
if hasattr(select, 'devpoll')
if hasattr(select, 'kqueue')
if hasattr(select, 'devpoll'):
if hasattr(select, 'kqueue'):
if os.sep == "\\":
View
@@ -4,27 +4,28 @@ matrix:
include:
- python: 2.6
- python: 2.7
- python: 3.2
- python: 3.3
- python: 3.4
- python: 3.5
- language: generic
os: osx
env: PYVER=py26
- language: generic
os: osx
env: PYVER=py27
- language: generic
os: osx
env: PYVER=py32
- language: generic
os: osx
env: PYVER=py33
- language: generic
os: osx
env: PYVER=py34
# XXX - not supported yet
# - language: generic
# os: osx
# env: PYVER=py35
install:
- ./.ci/travis/install.sh
script:
- ./.ci/travis/run.sh
# after_success:
# - coveralls # upload reports to coveralls.io
after_success:
- coveralls # upload reports to coveralls.io
View
@@ -14,6 +14,10 @@
:target: https://travis-ci.org/giampaolo/pyftpdlib
:alt: Travis
.. image:: https://coveralls.io/repos/giampaolo/pyftpdlib/badge.svg?branch=master&service=github
:target: https://coveralls.io/github/giampaolo/pyftpdlib?branch=master
:alt: Test coverage (coverall.io)
Quick links
===========
View
@@ -52,7 +52,8 @@ install:
# - ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
# - "%PYTHON%/python.exe C:/get-pip.py"
# - "%PYTHON%/python.exe -m pip install ..."
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install pip install -U pyopenssl ipaddress unittest2 --upgrade"
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install pip --upgrade"
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install unittest2 ipaddress pypiwin32 wmi wheel setuptools pyopenssl --upgrade"
# 1.0.1 is the latest release supporting python 2.6
- "%WITH_COMPILER% %PYTHON%/Scripts/pip.exe install mock==1.0.1"
- "%WITH_COMPILER% %PYTHON%/python.exe setup.py install"
View
@@ -569,7 +569,7 @@ def poll(self, timeout):
# --- /dev/poll - Solaris (introduced in python 3.3)
# ===================================================================
if hasattr(select, 'devpoll'):
if hasattr(select, 'devpoll'): # pragma: no cover
class DevPoll(_BasePollEpoll):
"""/dev/poll based poller (introduced in python 3.3)."""
@@ -630,7 +630,7 @@ def close(self):
# --- kqueue() - BSD / OSX
# ===================================================================
if hasattr(select, 'kqueue'):
if hasattr(select, 'kqueue'): # pragma: no cover
class Kqueue(_IOLoop):
"""kqueue() based poller."""
@@ -2406,7 +2406,7 @@ def test_port_race_condition(self):
bytes = hbytes + pbytes
cmd = 'PORT ' + ','.join(bytes) + '\r\n'
self.client.sock.sendall(b(cmd))
self.client.quit()
self.client.getresp()
s, addr = sock.accept()
s.close()
@@ -186,8 +186,7 @@ class PollIOLoopTestCase(unittest.TestCase, BaseIOLoopTestCase):
def test_eintr_on_poll(self):
# EINTR is supposed to be ignored
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
if not PY3:
m.return_value.poll.side_effect = select.error
m.return_value.poll.side_effect.errno = errno.EINTR
@@ -197,8 +196,7 @@ def test_eintr_on_poll(self):
s.poll(0)
assert m.called
# ...but just that
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
if not PY3:
m.return_value.poll.side_effect = select.error
m.return_value.poll.side_effect.errno = errno.EBADF
@@ -210,39 +208,34 @@ def test_eintr_on_poll(self):
def test_eexist_on_register(self):
# EEXIST is supposed to be ignored
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.register.side_effect = \
EnvironmentError(errno.EEXIST, "")
s, rd, wr = self.test_register()
# ...but just that
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.register.side_effect = \
EnvironmentError(errno.EBADF, "")
self.assertRaises(EnvironmentError, self.test_register)
def test_enoent_ebadf_on_unregister(self):
# ENOENT and EBADF are supposed to be ignored
for errnum in (errno.EBADF, errno.ENOENT):
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.unregister.side_effect = \
EnvironmentError(errnum, "")
s, rd, wr = self.test_register()
s.unregister(rd)
# ...but just those
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.unregister.side_effect = \
EnvironmentError(errno.EEXIST, "")
s, rd, wr = self.test_register()
self.assertRaises(EnvironmentError, s.unregister, rd)
def test_enoent_on_modify(self):
# ENOENT is supposed to be ignored
with mock.patch(self.poller_mock,
return_vaue=mock.Mock()) as m:
with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
m.return_value.modify.side_effect = \
OSError(errno.ENOENT, "")
s, rd, wr = self.test_register()

0 comments on commit d4800fd

Please sign in to comment.