From 1c8bb217901ab3feda34f5bf52b1634e2e7e402d Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Thu, 31 Dec 2015 21:33:37 +0200 Subject: [PATCH] fix python 2.6 unitests which with the backport package unittest2 --- .travis.yml | 1 + tests/test_bot.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e5a204d01..0b683c68a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ python: install: - pip install pylint flake8 coveralls - pip install -r requirements.txt + - 'if [[ $TRAVIS_PYTHON_VERSION == 2.6 ]]; then pip install unittest2; fi' script: - nosetests --with-coverage --cover-package telegram/ - flake8 telegram diff --git a/tests/test_bot.py b/tests/test_bot.py index 8c6d9949b..47c2c9cc1 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -20,9 +20,14 @@ """This module contains a object that represents Tests for Telegram Bot""" import os -import unittest from datetime import datetime import sys + +if sys.version_info[0:2] == (2, 6): + import unittest2 as unittest +else: + import unittest + sys.path.append('.') import telegram