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

Commitf9f2cb1

Browse files
committed
MAINT: Updated tick and category test formatting
1 parentf858cc5 commitf9f2cb1

File tree

3 files changed

+471
-429
lines changed

3 files changed

+471
-429
lines changed

‎lib/matplotlib/tests/test_category.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,25 @@ def lt(tl):
121121

122122

123123
classTestPlot(object):
124+
bytes_data= [
125+
['a','b','c'],
126+
[b'a',b'b',b'c'],
127+
np.array([b'a',b'b',b'c'])
128+
]
129+
130+
bytes_ids= ['string list','bytes list','bytes ndarray']
131+
132+
numlike_data= [
133+
['1','11','3'],
134+
np.array(['1','11','3']),
135+
[b'1',b'11',b'3'],
136+
np.array([b'1',b'11',b'3']),
137+
]
138+
139+
numlike_ids= [
140+
'string list','string ndarray','bytes list','bytes ndarray'
141+
]
142+
124143
@pytest.fixture
125144
defdata(self):
126145
self.d= ['a','b','c','a']
@@ -171,12 +190,7 @@ def test_plot_1d_missing(self):
171190
self.axis_test(ax.yaxis,self.dmticks,self.dmlabels,self.dmunit_data)
172191

173192
@pytest.mark.usefixtures("data")
174-
@pytest.mark.parametrize("bars",
175-
[['a','b','c'],
176-
[b'a',b'b',b'c'],
177-
np.array([b'a',b'b',b'c'])],
178-
ids=['string list','bytes list',
179-
'bytes ndarray'])
193+
@pytest.mark.parametrize("bars",bytes_data,ids=bytes_ids)
180194
deftest_plot_bytes(self,bars):
181195
counts=np.array([4,6,5])
182196

@@ -186,13 +200,7 @@ def test_plot_bytes(self, bars):
186200

187201
self.axis_test(ax.xaxis,self.dticks,self.dlabels,self.dunit_data)
188202

189-
@pytest.mark.parametrize("bars",
190-
[['1','11','3'],
191-
np.array(['1','11','3']),
192-
[b'1',b'11',b'3'],
193-
np.array([b'1',b'11',b'3'])],
194-
ids=['string list','string ndarray',
195-
'bytes list','bytes ndarray'])
203+
@pytest.mark.parametrize("bars",numlike_data,ids=numlike_ids)
196204
deftest_plot_numlike(self,bars):
197205
counts=np.array([4,6,5])
198206

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp