[Pkg-mpd-commits] [python-mpd] 102/262: test.py print error if unittest module is too old
Simon McVittie
smcv at debian.org
Sun May 22 18:16:30 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch upstream
in repository python-mpd.
commit ac2076a68e8ed015966364daf7d6a1ba0f8ca1ad
Author: Jörg Thalheim <jthalheim at gmail.com>
Date: Fri Feb 17 17:09:01 2012 +0100
test.py print error if unittest module is too old
Before it only test, if unittest is avaible, which will always be the
case.
---
test.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test.py b/test.py
index 01ea4d9..babf8c7 100755
--- a/test.py
+++ b/test.py
@@ -12,10 +12,11 @@ try:
except ImportError:
# required for python3
# python2.7 works with this module too!
- try:
+ if sys.version_info >= (2, 1, 7):
import unittest
- except ImportError:
+ else:
print("Please install unittest2 from pypi to run tests!")
+ sys.exit(1)
# Alternate this to your setup
# Make sure you have at least one song on your playlist
--
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