File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
pandas/tests/series/methods Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -193,11 +193,20 @@ def test_info_memory_usage_bug_on_multiindex():
193193
194194
195195def test_info_show_counts_false ():
196- # GH#62590
197- s = Series ([1 , 2 , None ])
196+ s = Series ([1 ])
198197 buf = StringIO ()
199198 s .info (buf = buf , show_counts = False )
200199 result = buf .getvalue ()
201- assert "Non-Null Count" not in result
202- assert "<class 'pandas.Series'>" in result
203- assert "Dtype" in result
200+ memory_bytes = float (s .memory_usage ())
201+ expected = textwrap .dedent (
202+ f"""\
203+ <class 'pandas.Series'>
204+ RangeIndex: 1 entries, 0 to 0
205+ Series name: None
206+ Dtype
207+ -----
208+ int64
209+ dtypes: int64(1)
210+ memory usage: { memory_bytes } bytes"""
211+ )
212+ assert result .strip () == expected .strip ()
You can’t perform that action at this time.
0 commit comments