Skip to content

Commit e6ca02c

Browse files
committed
Tests for Period immutability
1 parent 89cf9d6 commit e6ca02c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/test_lib.py

+11
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,14 @@ def test_empty_like(self):
248248
expected = np.array([True])
249249

250250
self._check_behavior(arr, expected)
251+
252+
253+
254+
def test_period_immutable():
255+
per = pd.Period('2014Q1')
256+
with pytest.raises(AttributeError, message="is not writable"):
257+
per.ordinal = 14
258+
259+
freq = per.freq
260+
with pytest.raises(AttributeError, message="is not writable"):
261+
per.freq = 2*freq

0 commit comments

Comments
 (0)