11from __future__ import print_function
2- from nose .tools import assert_equal , assert_raises
2+ from nose .tools import assert_raises
33from numpy .testing import assert_almost_equal
44import numpy as np
55
88
99def test_MaxNLocator ():
1010 loc = mticker .MaxNLocator (nbins = 5 )
11- test_value = np .array ([ 20. , 40. , 60. , 80. , 100. ])
11+ test_value = np .array ([20. , 40. , 60. , 80. , 100. ])
1212 assert_almost_equal (loc .tick_values (20 , 100 ), test_value )
1313
14- test_value = np .array ([ 0. , 0.0002 , 0.0004 , 0.0006 , 0.0008 , 0.001 ])
14+ test_value = np .array ([0. , 0.0002 , 0.0004 , 0.0006 , 0.0008 , 0.001 ])
1515 assert_almost_equal (loc .tick_values (0.001 , 0.0001 ), test_value )
1616
1717 test_value = np .array ([- 1.0e+15 , - 5.0e+14 , 0e+00 , 5e+14 , 1.0e+15 ])
@@ -33,9 +33,7 @@ def test_MultipleLocator():
3333def test_LogLocator ():
3434 loc = mticker .LogLocator (numticks = 5 )
3535
36- # make sure the 0 case is covered with an exception
37- with assert_raises (ValueError ):
38- loc .tick_values (0 , 1000 )
36+ assert_raises (ValueError , loc .tick_values , 0 , 1000 )
3937
4038 test_value = np .array ([1.00000000e-03 , 1.00000000e-01 , 1.00000000e+01 ,
4139 1.00000000e+03 , 1.00000000e+05 , 1.00000000e+07 ])
@@ -46,6 +44,6 @@ def test_LogLocator():
4644 assert_almost_equal (loc .tick_values (1 , 100 ), test_value )
4745
4846
49- if __name__ == '__main__' :
47+ if __name__ == '__main__' :
5048 import nose
51- nose .runmodule (argv = ['-s' ,'--with-doctest' ], exit = False )
49+ nose .runmodule (argv = ['-s' , '--with-doctest' ], exit = False )
0 commit comments