@@ -91,7 +91,7 @@ def test__EventCollection__get_orientation():
91
91
orientation
92
92
'''
93
93
_ , coll , props = generate_EventCollection_plot ()
94
- assert_equal ( props ['orientation' ], coll .get_orientation () )
94
+ assert props ['orientation' ] == coll .get_orientation ()
95
95
96
96
97
97
@cleanup
@@ -101,7 +101,7 @@ def test__EventCollection__is_horizontal():
101
101
orientation
102
102
'''
103
103
_ , coll , _ = generate_EventCollection_plot ()
104
- assert_equal ( True , coll .is_horizontal () )
104
+ assert coll .is_horizontal ()
105
105
106
106
107
107
@cleanup
@@ -110,7 +110,7 @@ def test__EventCollection__get_linelength():
110
110
check to make sure the default linelength matches the input linelength
111
111
'''
112
112
_ , coll , props = generate_EventCollection_plot ()
113
- assert_equal ( props ['linelength' ], coll .get_linelength () )
113
+ assert props ['linelength' ] == coll .get_linelength ()
114
114
115
115
116
116
@cleanup
@@ -119,7 +119,7 @@ def test__EventCollection__get_lineoffset():
119
119
check to make sure the default lineoffset matches the input lineoffset
120
120
'''
121
121
_ , coll , props = generate_EventCollection_plot ()
122
- assert_equal ( props ['lineoffset' ], coll .get_lineoffset () )
122
+ assert props ['lineoffset' ] == coll .get_lineoffset ()
123
123
124
124
125
125
@cleanup
@@ -128,7 +128,7 @@ def test__EventCollection__get_linestyle():
128
128
check to make sure the default linestyle matches the input linestyle
129
129
'''
130
130
_ , coll , _ = generate_EventCollection_plot ()
131
- assert_equal ( coll .get_linestyle (), [(None , None )])
131
+ assert coll .get_linestyle () == [(None , None )]
132
132
133
133
134
134
@cleanup
@@ -223,8 +223,8 @@ def test__EventCollection__switch_orientation():
223
223
splt , coll , props = generate_EventCollection_plot ()
224
224
new_orientation = 'vertical'
225
225
coll .switch_orientation ()
226
- assert_equal ( new_orientation , coll .get_orientation () )
227
- assert_equal ( False , coll .is_horizontal () )
226
+ assert new_orientation == coll .get_orientation ()
227
+ assert not coll .is_horizontal ()
228
228
new_positions = coll .get_positions ()
229
229
check_segments (coll ,
230
230
new_positions ,
@@ -246,8 +246,8 @@ def test__EventCollection__switch_orientation_2x():
246
246
coll .switch_orientation ()
247
247
coll .switch_orientation ()
248
248
new_positions = coll .get_positions ()
249
- assert_equal ( props ['orientation' ], coll .get_orientation () )
250
- assert_equal ( True , coll .is_horizontal () )
249
+ assert props ['orientation' ] == coll .get_orientation ()
250
+ assert coll .is_horizontal ()
251
251
np .testing .assert_array_equal (props ['positions' ], new_positions )
252
252
check_segments (coll ,
253
253
new_positions ,
@@ -265,8 +265,8 @@ def test__EventCollection__set_orientation():
265
265
splt , coll , props = generate_EventCollection_plot ()
266
266
new_orientation = 'vertical'
267
267
coll .set_orientation (new_orientation )
268
- assert_equal ( new_orientation , coll .get_orientation () )
269
- assert_equal ( False , coll .is_horizontal () )
268
+ assert new_orientation == coll .get_orientation ()
269
+ assert_ not coll .is_horizontal ()
270
270
check_segments (coll ,
271
271
props ['positions' ],
272
272
props ['linelength' ],
@@ -285,7 +285,7 @@ def test__EventCollection__set_linelength():
285
285
splt , coll , props = generate_EventCollection_plot ()
286
286
new_linelength = 15
287
287
coll .set_linelength (new_linelength )
288
- assert_equal ( new_linelength , coll .get_linelength () )
288
+ assert new_linelength == coll .get_linelength ()
289
289
check_segments (coll ,
290
290
props ['positions' ],
291
291
new_linelength ,
@@ -303,7 +303,7 @@ def test__EventCollection__set_lineoffset():
303
303
splt , coll , props = generate_EventCollection_plot ()
304
304
new_lineoffset = - 5.
305
305
coll .set_lineoffset (new_lineoffset )
306
- assert_equal ( new_lineoffset , coll .get_lineoffset () )
306
+ assert new_lineoffset == coll .get_lineoffset ()
307
307
check_segments (coll ,
308
308
props ['positions' ],
309
309
props ['linelength' ],
@@ -321,7 +321,7 @@ def test__EventCollection__set_linestyle():
321
321
splt , coll , _ = generate_EventCollection_plot ()
322
322
new_linestyle = 'dashed'
323
323
coll .set_linestyle (new_linestyle )
324
- assert_equal ( coll .get_linestyle (), [(0 , (6.0 , 6.0 ))])
324
+ assert coll .get_linestyle () == [(0 , (6.0 , 6.0 ))]
325
325
splt .set_title ('EventCollection: set_linestyle' )
326
326
327
327
@@ -334,7 +334,7 @@ def test__EventCollection__set_linestyle_single_dash():
334
334
splt , coll , _ = generate_EventCollection_plot ()
335
335
new_linestyle = (0 , (6. , 6. ))
336
336
coll .set_linestyle (new_linestyle )
337
- assert_equal ( coll .get_linestyle (), [(0 , (6.0 , 6.0 ))])
337
+ assert coll .get_linestyle () == [(0 , (6.0 , 6.0 ))]
338
338
splt .set_title ('EventCollection: set_linestyle' )
339
339
340
340
@@ -346,7 +346,7 @@ def test__EventCollection__set_linewidth():
346
346
splt , coll , _ = generate_EventCollection_plot ()
347
347
new_linewidth = 5
348
348
coll .set_linewidth (new_linewidth )
349
- assert_equal ( coll .get_linewidth (), new_linewidth )
349
+ assert coll .get_linewidth () == new_linewidth
350
350
splt .set_title ('EventCollection: set_linewidth' )
351
351
352
352
@@ -385,10 +385,10 @@ def check_segments(coll, positions, linelength, lineoffset, orientation):
385
385
386
386
# test to make sure each segment is correct
387
387
for i , segment in enumerate (segments ):
388
- assert_equal ( segment [0 , pos1 ], lineoffset + linelength / 2. )
389
- assert_equal ( segment [1 , pos1 ], lineoffset - linelength / 2. )
390
- assert_equal ( segment [0 , pos2 ], positions [i ])
391
- assert_equal ( segment [1 , pos2 ], positions [i ])
388
+ assert segment [0 , pos1 ] == lineoffset + linelength / 2.
389
+ assert segment [1 , pos1 ] == lineoffset - linelength / 2.
390
+ assert segment [0 , pos2 ] == positions [i ]
391
+ assert segment [1 , pos2 ] == positions [i ]
392
392
393
393
394
394
def check_allprop (values , target ):
@@ -398,7 +398,7 @@ def check_allprop(values, target):
398
398
note: this is not a test, it is used by tests
399
399
'''
400
400
for value in values :
401
- assert_equal ( value , target )
401
+ assert value == target
402
402
403
403
404
404
def check_allprop_array (values , target ):
@@ -428,7 +428,7 @@ def test_add_collection():
428
428
ax .add_collection (coll )
429
429
bounds = ax .dataLim .bounds
430
430
coll = ax .scatter ([], [])
431
- assert_equal ( ax .dataLim .bounds , bounds )
431
+ assert ax .dataLim .bounds == bounds
432
432
433
433
434
434
@cleanup
@@ -437,7 +437,7 @@ def test_quiver_limits():
437
437
x , y = np .arange (8 ), np .arange (10 )
438
438
data = u = v = np .linspace (0 , 10 , 80 ).reshape (10 , 8 )
439
439
q = plt .quiver (x , y , u , v )
440
- assert_equal ( q .get_datalim (ax .transData ).bounds , (0. , 0. , 7. , 9. ) )
440
+ assert q .get_datalim (ax .transData ).bounds == (0. , 0. , 7. , 9. )
441
441
442
442
plt .figure ()
443
443
ax = plt .axes ()
@@ -446,7 +446,7 @@ def test_quiver_limits():
446
446
y , x = np .meshgrid (y , x )
447
447
trans = mtransforms .Affine2D ().translate (25 , 32 ) + ax .transData
448
448
plt .quiver (x , y , np .sin (x ), np .cos (y ), transform = trans )
449
- assert_equal ( ax .dataLim .bounds , (20.0 , 30.0 , 15.0 , 6.0 ) )
449
+ assert ax .dataLim .bounds == (20.0 , 30.0 , 15.0 , 6.0 )
450
450
451
451
452
452
@cleanup
0 commit comments