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

Skip to content

Commit 178d6a1

Browse files
committed
MAINT moved test_lines to pytest
1 parent c6264ca commit 178d6a1

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@ def _jupyter_nbextension_paths():
14981498
'matplotlib.tests.test_figure',
14991499
'matplotlib.tests.test_font_manager',
15001500
'matplotlib.tests.test_gridspec',
1501-
'matplotlib.tests.test_lines',
15021501
'matplotlib.tests.test_mathtext',
15031502
'matplotlib.tests.test_mlab',
15041503
'matplotlib.tests.test_offsetbox',

lib/matplotlib/tests/test_lines.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
from __future__ import (absolute_import, division, print_function,
55
unicode_literals)
66

7-
import six
87
import itertools
98
import matplotlib.lines as mlines
10-
import nose
11-
from nose.tools import assert_true, assert_raises
9+
from numpy.testing import assert_raises
1210
from timeit import repeat
1311
import numpy as np
1412
from cycler import cycler
@@ -59,7 +57,7 @@ def test_invisible_Line_rendering():
5957

6058
slowdown_factor = (t_unvisible_line/t_no_line)
6159
slowdown_threshold = 2 # trying to avoid false positive failures
62-
assert_true(slowdown_factor < slowdown_threshold)
60+
assert slowdown_factor < slowdown_threshold
6361

6462

6563
@cleanup
@@ -186,10 +184,6 @@ def test_lw_scaling():
186184

187185
def test_nan_is_sorted():
188186
line = mlines.Line2D([], [])
189-
assert_true(line._is_sorted(np.array([1, 2, 3])))
190-
assert_true(line._is_sorted(np.array([1, np.nan, 3])))
191-
assert_true(not line._is_sorted([3, 5] + [np.nan] * 100 + [0, 2]))
192-
193-
194-
if __name__ == '__main__':
195-
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)
187+
assert line._is_sorted(np.array([1, 2, 3]))
188+
assert line._is_sorted(np.array([1, np.nan, 3]))
189+
assert not line._is_sorted([3, 5] + [np.nan] * 100 + [0, 2])

0 commit comments

Comments
 (0)