forked from VimPlug/jedi
Use unittest2 for Python < 2.7
This commit is contained in:
@@ -5,7 +5,12 @@ python:
|
|||||||
- 2.7
|
- 2.7
|
||||||
- 3.2
|
- 3.2
|
||||||
install:
|
install:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install --use-mirrors simplejson; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then
|
||||||
|
pip install --use-mirrors simplejson unittest2;
|
||||||
|
fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then
|
||||||
|
pip install --use-mirrors unittest2;
|
||||||
|
fi
|
||||||
- pip install --use-mirrors nose
|
- pip install --use-mirrors nose
|
||||||
script:
|
script:
|
||||||
- cd test
|
- cd test
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import unittest
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import sys
|
import sys
|
||||||
|
if sys.hexversion < 0x02070000:
|
||||||
|
import unittest2 as unittest
|
||||||
|
else:
|
||||||
|
import unittest
|
||||||
import os
|
import os
|
||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
import functools
|
import functools
|
||||||
|
|||||||
@@ -5,14 +5,13 @@ Unit tests to avoid errors of the past. Makes use of Python's ``unittest``
|
|||||||
module.
|
module.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import unittest
|
|
||||||
import time
|
import time
|
||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from base import TestBase, cwd_at
|
from base import TestBase, unittest, cwd_at
|
||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
from jedi._compatibility import is_py25, utf8, unicode
|
from jedi._compatibility import is_py25, utf8, unicode
|
||||||
@@ -130,11 +129,7 @@ class TestRegression(TestBase):
|
|||||||
defs = self.definition_when_in_function_call('f( ', ')')
|
defs = self.definition_when_in_function_call('f( ', ')')
|
||||||
desc = defs[0].description
|
desc = defs[0].description
|
||||||
if desc == 'keyword )':
|
if desc == 'keyword )':
|
||||||
try:
|
self.skipTest('finding definition at ``f( |)`` does not work')
|
||||||
self.skipTest('finding definition at ``f( |)`` does not work')
|
|
||||||
except AttributeError:
|
|
||||||
# old unittest does not support skip
|
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
self.assertEqual(desc, 'def f')
|
self.assertEqual(desc, 'def f')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user