[Pkg-mpd-commits] [python-mpd] 23/91: exclude python 3.2 from twisted testing
Simon McVittie
smcv at debian.org
Sat Feb 24 14:55:29 UTC 2018
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository python-mpd.
commit e06c09fc062a935c83cb57c04388109e1a97681a
Author: Jörg Thalheim <joerg at higgsboson.tk>
Date: Mon Sep 12 12:22:42 2016 +0200
exclude python 3.2 from twisted testing
---
.travis.yml | 2 +-
mpd/tests.py | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 65669ce..8aec8db 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,6 @@ python:
- "pypy"
install:
- - pip install Twisted
+ - if [[ $TRAVIS_PYTHON_VERSION != '3.2' ]]; then pip install Twisted; fi
script: python -m unittest mpd.tests
diff --git a/mpd/tests.py b/mpd/tests.py
index b1da61e..c99c206 100755
--- a/mpd/tests.py
+++ b/mpd/tests.py
@@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
-from twisted.python.failure import Failure
import itertools
import mpd
import sys
@@ -23,6 +22,14 @@ except ImportError:
sys.exit(1)
try:
+ from twisted.python.failure import Failure
+ TWISTED_MISSING = False
+except ImportError:
+ warnings.warn("No twisted installed: skip twisted related tests! " +
+ "(twisted is not available for python >= 3.0 && python < 3.3)")
+ TWISTED_MISSING = True
+
+try:
import mock
except ImportError:
print("Please install mock from PyPI to run tests!")
@@ -614,6 +621,7 @@ class MockTransport(object):
self.written.append(data)
+ at unittest.skipIf(TWISTED_MISSING, "requires twisted to be installed")
class TestMPDProtocol(unittest.TestCase):
def init_protocol(self, default_idle=True, idle_result=None):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git
More information about the Pkg-mpd-commits
mailing list