Skip to content

Commit 5105121

Browse files
committed
tests: fix missing SkipTest imports
1 parent 90149cb commit 5105121

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

test/common.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
try:
2+
from nose.plugins.skip import SkipTest
3+
except ImportError:
4+
try:
5+
from unittest.case import SkipTest # Python >= 2.7
6+
except ImportError:
7+
try:
8+
from unittest2.case import SkipTest # Python < 2.7
9+
except ImportError:
10+
class SkipTest(Exception):
11+
"""Raise this exception to mark a test as skipped.
12+
"""
13+
pass
14+
15+
116
try:
217
from nose.tools import assert_equal, assert_in, assert_raises
318

test/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from __future__ import unicode_literals
77
from tabulate import tabulate, tabulate_formats, simple_separated_format
88
from platform import python_version_tuple
9-
from nose.plugins.skip import SkipTest
9+
from common import SkipTest
1010

1111

1212
try:

test/test_input.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from __future__ import print_function
66
from __future__ import unicode_literals
77
from tabulate import tabulate
8-
from common import assert_equal, assert_in, assert_raises
9-
from nose.plugins.skip import SkipTest
8+
from common import assert_equal, assert_in, assert_raises, SkipTest
109

1110

1211
def test_iterable_of_iterables():

test/test_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from __future__ import print_function
66
from __future__ import unicode_literals
77
from tabulate import tabulate, simple_separated_format
8-
from common import assert_equal, assert_raises
8+
from common import assert_equal, assert_raises, SkipTest
99

1010

1111
# _test_table shows

test/test_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from __future__ import print_function
66
from __future__ import unicode_literals
77
from tabulate import tabulate, _text_type, _long_type
8-
from common import assert_equal, assert_in
8+
from common import assert_equal, assert_in, SkipTest
99

1010

1111
def test_ansi_color_in_table_cells():

0 commit comments

Comments
 (0)