fix python 2.6 unitests which with the backport package unittest2

This commit is contained in:
Noam Meltzer 2015-12-31 21:33:37 +02:00
parent 054c976ad6
commit 1c8bb21790
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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