Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd6a88e

Browse files
Update unittest attune to numpy standards
1 parent15571fc commitbd6a88e

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

‎lib/matplotlib/tests/test_scale.py‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
importio
1515
importpytest
1616

17-
importrandom
18-
1917

2018
@check_figures_equal()
2119
deftest_log_scales(fig_test,fig_ref):
@@ -60,21 +58,17 @@ def test_symlog_mask_nan():
6058
deftest_symlog_linthresh():
6159
fig,ax=plt.subplots()
6260

63-
n_samples=100
64-
65-
upper_bound=1.0
61+
np.random.seed(19680801)
62+
x=np.random.random(100)
63+
y=np.random.random(100)
6664

67-
x= [random.uniform(0.0,upper_bound)for_inrange(n_samples)]
68-
y= [random.uniform(0.0,upper_bound)for_inrange(n_samples)]
65+
plt.plot(x,y,'o')
66+
ax.set_xscale('symlog')
67+
ax.set_yscale('symlog')
6968

70-
withpytest.warns(UserWarning)asrecord:
71-
plt.plot(x,y,'o')
72-
ax.set_xscale('symlog')
73-
ax.set_yscale('symlog')
69+
withpytest.warns(UserWarning):
7470
plt.show()
7571

76-
assertlen(record)==1
77-
7872

7973
@image_comparison(['logit_scales.png'],remove_text=True)
8074
deftest_logit_scales():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp