Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30e40c6

Browse files
committed
Skip broken category test with NumPy < 1.8.0.
1 parent 02d7cf8 commit 30e40c6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/matplotlib/tests/test_category.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from __future__ import (absolute_import, division, print_function,
44
unicode_literals)
55

6+
from distutils.version import LooseVersion
7+
68
import pytest
79
import numpy as np
810

@@ -12,6 +14,11 @@
1214
import unittest
1315

1416

17+
needs_new_numpy = pytest.mark.xfail(
18+
LooseVersion(np.__version__) < LooseVersion('1.8.0'),
19+
reason='NumPy < 1.8.0 is broken.')
20+
21+
1522
class TestUnitData(object):
1623
testdata = [("hello world", ["hello world"], [0]),
1724
("Здравствуйте мир", ["Здравствуйте мир"], [0]),
@@ -21,12 +28,14 @@ class TestUnitData(object):
2128

2229
ids = ["single", "unicode", "mixed"]
2330

31+
@needs_new_numpy
2432
@pytest.mark.parametrize("data, seq, locs", testdata, ids=ids)
2533
def test_unit(self, data, seq, locs):
2634
act = cat.UnitData(data)
2735
assert act.seq == seq
2836
assert act.locs == locs
2937

38+
@needs_new_numpy
3039
def test_update_map(self):
3140
data = ['a', 'd']
3241
oseq = ['a', 'd']
@@ -78,6 +87,7 @@ class TestStrCategoryConverter(object):
7887
def mock_axis(self, request):
7988
self.cc = cat.StrCategoryConverter()
8089

90+
@needs_new_numpy
8191
@pytest.mark.parametrize("data, unitmap, exp", testdata, ids=ids)
8292
def test_convert(self, data, unitmap, exp):
8393
MUD = MockUnitData(unitmap)

0 commit comments

Comments
 (0)