|
10 | 10 | from plotly import exceptions |
11 | 11 | from nose.tools import raises |
12 | 12 | import six |
13 | | -import json |
14 | 13 |
|
15 | 14 | from unittest import TestCase |
16 | | -from unittest import skipIf |
| 15 | + |
| 16 | +version = six.sys.version_info[:2] # need this for conditional testing |
17 | 17 |
|
18 | 18 |
|
19 | 19 | # username for tests: 'plotlyimagetest' |
@@ -198,12 +198,18 @@ def test_all(): |
198 | 198 |
|
199 | 199 | class TestBytesVStrings(TestCase): |
200 | 200 |
|
201 | | - @skipIf(not six.PY3, 'Decoding and missing escapes is only seen in PY3') |
202 | | - def test_proper_escaping(self): |
203 | | - un = 'PlotlyImageTest' |
204 | | - ak = '786r5mecv0' |
205 | | - url = "https://plot.ly/~PlotlyImageTest/91/" |
206 | | - py.sign_in(un, ak) |
207 | | - print("getting: https://plot.ly/~PlotlyImageTest/91/") |
208 | | - print("###########################################\n\n") |
209 | | - fig = py.get_figure(url) |
| 201 | + # unittest `skipIf` not supported in 2.6 |
| 202 | + if version < (2, 7) or (2, 7) < version < (3, 3): |
| 203 | + pass |
| 204 | + else: |
| 205 | + from unittest import skipIf |
| 206 | + |
| 207 | + @skipIf(not six.PY3, 'Decoding and missing escapes only seen in PY3') |
| 208 | + def test_proper_escaping(self): |
| 209 | + un = 'PlotlyImageTest' |
| 210 | + ak = '786r5mecv0' |
| 211 | + url = "https://plot.ly/~PlotlyImageTest/91/" |
| 212 | + py.sign_in(un, ak) |
| 213 | + print("getting: https://plot.ly/~PlotlyImageTest/91/") |
| 214 | + print("###########################################\n\n") |
| 215 | + fig = py.get_figure(url) |
0 commit comments