File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed
pandas/tests/series/indexing Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -604,28 +604,24 @@ def test_indexing_over_size_cutoff():
604
604
_index ._SIZE_CUTOFF = old_cutoff
605
605
606
606
607
- def test_indexing_over_size_cutoff_period_index ():
607
+ def test_indexing_over_size_cutoff_period_index (monkeypatch ):
608
608
# GH 27136
609
609
610
- old_cutoff = _index ._SIZE_CUTOFF
611
- try :
612
- _index ._SIZE_CUTOFF = 1000
610
+ monkeypatch .setattr (_index , "_SIZE_CUTOFF" , 1000 )
613
611
614
- n = 1100
615
- idx = pd .period_range ("1/1/2000" , freq = "T" , periods = n )
616
- assert idx ._engine .over_size_threshold
612
+ n = 1100
613
+ idx = pd .period_range ("1/1/2000" , freq = "T" , periods = n )
614
+ assert idx ._engine .over_size_threshold
617
615
618
- s = pd .Series (np .random .randn (len (idx )), index = idx )
616
+ s = pd .Series (np .random .randn (len (idx )), index = idx )
619
617
620
- pos = n - 1
621
- timestamp = idx [pos ]
622
- assert timestamp in s .index
618
+ pos = n - 1
619
+ timestamp = idx [pos ]
620
+ assert timestamp in s .index
623
621
624
- # it works!
625
- s [timestamp ]
626
- assert len (s .loc [[timestamp ]]) > 0
627
- finally :
628
- _index ._SIZE_CUTOFF = old_cutoff
622
+ # it works!
623
+ s [timestamp ]
624
+ assert len (s .loc [[timestamp ]]) > 0
629
625
630
626
631
627
def test_indexing_unordered ():
You can’t perform that action at this time.
0 commit comments