Skip to content

Commit f6c9569

Browse files
committed
TST: more test coverage for release target
1 parent ed383bd commit f6c9569

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

pandas/io/parsers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def read_clipboard(**kwargs): # pragma: no cover
153153
text = clipboard_get()
154154
return read_table(StringIO(text), **kwargs)
155155

156-
def to_clipboard(obj):
156+
def to_clipboard(obj): # pragma: no cover
157157
"""
158158
Attempt to write text representation of object to the system clipboard
159159

pandas/sparse/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def fillna(self, value=None, method='pad', inplace=False):
432432
fill_value=self.fill_value)
433433

434434
if inplace:
435-
self.sp_values[:] = result.sp_values
435+
self.sp_values[:] = result.values
436436
return self
437437
else:
438438
return result

pandas/sparse/tests/test_sparse.py

+10
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,16 @@ def test_fillna(self):
10531053
expected = df.to_dense().fillna(0).to_sparse(fill_value=0)
10541054
assert_sp_frame_equal(result, expected)
10551055

1056+
result = df.copy()
1057+
result.fillna(0, inplace=True)
1058+
expected = df.to_dense().fillna(0).to_sparse(fill_value=0)
1059+
assert_sp_frame_equal(result, expected)
1060+
1061+
result = df.copy()
1062+
result = df['A']
1063+
result.fillna(0, inplace=True)
1064+
assert_series_equal(result, df['A'].fillna(0))
1065+
10561066
def test_rename(self):
10571067
# just check this works
10581068
renamed = self.frame.rename(index=str)

pandas/tests/test_graphics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class TestSeriesPlots(unittest.TestCase):
1414

1515
@classmethod
1616
def setUpClass(cls):
17-
#import sys
18-
#if 'IPython' in sys.modules:
19-
# raise nose.SkipTest
17+
import sys
18+
if 'IPython' in sys.modules:
19+
raise nose.SkipTest
2020

2121
try:
2222
import matplotlib as mpl
@@ -50,9 +50,9 @@ class TestDataFramePlots(unittest.TestCase):
5050

5151
@classmethod
5252
def setUpClass(cls):
53-
#import sys
54-
#if 'IPython' in sys.modules:
55-
# raise nose.SkipTest
53+
import sys
54+
if 'IPython' in sys.modules:
55+
raise nose.SkipTest
5656

5757
try:
5858
import matplotlib as mpl

pandas/tests/test_series.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ def test_between(self):
11491149
expected = s[5:16].dropna()
11501150
assert_series_equal(result, expected)
11511151

1152-
def test_scalar_na_cmp(self):
1152+
def test_scalar_na_cmp_corners(self):
11531153
s = Series([2,3,4,5,6,7,8,9,10])
11541154
s[::2] = np.nan
11551155

@@ -1158,6 +1158,14 @@ def tester(a, b):
11581158

11591159
self.assertRaises(ValueError, tester, s, datetime(2005,1,1))
11601160

1161+
s = Series([2,3,4,5,6,7,8,9,datetime(2005,1,1)])
1162+
s[::2] = np.nan
1163+
1164+
assert_series_equal(tester(s, list(s)), s)
1165+
1166+
d = DataFrame({'A':s})
1167+
self.assertRaises(TypeError, tester, s, d)
1168+
11611169
def test_idxmin(self):
11621170
# test idxmin
11631171
# _check_stat_op approach can not be used here because of isnull check.
@@ -2047,7 +2055,7 @@ def test_ne(self):
20472055
def test_pad_nan(self):
20482056
x = TimeSeries([np.nan, 1., np.nan, 3., np.nan],
20492057
['z', 'a', 'b', 'c', 'd'], dtype=float)
2050-
x = x.fillna(method='pad')
2058+
x.fillna(method='pad', inplace=True)
20512059
expected = TimeSeries([np.nan, 1.0, 1.0, 3.0, 3.0],
20522060
['z', 'a', 'b', 'c', 'd'], dtype=float)
20532061
assert_series_equal(x[1:], expected[1:])

0 commit comments

Comments
 (0)