We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb0376c commit ebc80c7Copy full SHA for ebc80c7
pandas/tests/indexing/multiindex/test_getitem.py
@@ -83,9 +83,9 @@ def test_series_getitem_returns_scalar(
83
84
85
@pytest.mark.parametrize('indexer,expected_error,expected_error_msg', [
86
- (lambda s: s.__getitem__((2000, 3, 4)), KeyError, r"^356L?$"),
87
- (lambda s: s[(2000, 3, 4)], KeyError, r"^356L?$"),
88
- (lambda s: s.loc[(2000, 3, 4)], KeyError, r"^356L?$"),
+ (lambda s: s.__getitem__((2000, 3, 4)), KeyError, r"^356$"),
+ (lambda s: s[(2000, 3, 4)], KeyError, r"^356$"),
+ (lambda s: s.loc[(2000, 3, 4)], KeyError, r"^356$"),
89
(lambda s: s.loc[(2000, 3, 4, 5)], IndexingError, 'Too many indexers'),
90
(lambda s: s.__getitem__(len(s)), IndexError, 'index out of bounds'),
91
(lambda s: s[len(s)], IndexError, 'index out of bounds'),
pandas/tests/indexing/multiindex/test_loc.py
@@ -124,11 +124,11 @@ def test_loc_multiindex(self):
124
tm.assert_frame_equal(rs, xp)
125
126
# missing label
127
- with pytest.raises(KeyError, match=r"^2L?$"):
+ with pytest.raises(KeyError, match=r"^2$"):
128
mi_int.loc[2]
129
with catch_warnings(record=True):
130
# GH 21593
131
132
mi_int.ix[2]
133
134
def test_loc_multiindex_too_many_dims(self):
@@ -375,15 +375,15 @@ def test_loc_getitem_int(frame_random_data_integer_multi_index):
375
def test_loc_getitem_int_raises_exception(
376
frame_random_data_integer_multi_index):
377
df = frame_random_data_integer_multi_index
378
- with pytest.raises(KeyError, match=r"^3L?$"):
+ with pytest.raises(KeyError, match=r"^3$"):
379
df.loc[3]
380
381
382
def test_loc_getitem_lowerdim_corner(multiindex_dataframe_random_data):
383
df = multiindex_dataframe_random_data
384
385
# test setup - check key not in dataframe
386
- with pytest.raises(KeyError, match=r"^11L?$"):
+ with pytest.raises(KeyError, match=r"^11$"):
387
df.loc[('bar', 'three'), 'B']
388
389
# in theory should be inserting in a sorted space????
pandas/tests/series/indexing/test_datetime.py
@@ -406,7 +406,7 @@ def test_datetime_indexing():
406
s = Series(len(index), index=index)
407
stamp = Timestamp('1/8/2000')
408
409
- with pytest.raises(KeyError, match=r"^947289600000000000L?$"):
+ with pytest.raises(KeyError, match=r"^947289600000000000$"):
410
s[stamp]
411
s[stamp] = 0
412
assert s[stamp] == 0
@@ -415,7 +415,7 @@ def test_datetime_indexing():
415
416
s = s[::-1]
417
418
419
420
421
@@ -507,7 +507,7 @@ def test_duplicate_dates_indexing(dups):
507
expected = Series(np.where(mask, 0, ts), index=ts.index)
508
assert_series_equal(cp, expected)
509
510
- with pytest.raises(KeyError, match=r"^947116800000000000L?$"):
+ with pytest.raises(KeyError, match=r"^947116800000000000$"):
511
ts[datetime(2000, 1, 6)]
512
513
# new index
pandas/tests/series/indexing/test_indexing.py
@@ -256,9 +256,9 @@ def test_series_box_timestamp():
256
257
def test_getitem_ambiguous_keyerror():
258
s = Series(lrange(10), index=lrange(0, 20, 2))
259
- with pytest.raises(KeyError, match=r"^1L?$"):
+ with pytest.raises(KeyError, match=r"^1$"):
260
s[1]
261
262
s.loc[1]
263
264
pandas/tests/series/indexing/test_loc.py
@@ -74,9 +74,9 @@ def test_loc_getitem_setitem_integer_slice_keyerrors():
74
75
# non-monotonic, raise KeyError
76
s2 = s.iloc[lrange(5) + lrange(5, 10)[::-1]]
77
78
s2.loc[3:11]
79
80
s2.loc[3:11] = 0
81
82
pandas/tests/series/test_analytics.py
@@ -471,7 +471,7 @@ def test_dot(self):
471
assert_almost_equal(a.dot(b['1']), expected['1'])
472
assert_almost_equal(a.dot(b2['1']), expected['1'])
473
474
- msg = r"Dot product shape mismatch, \(4L?,\) vs \(3L?,\)"
+ msg = r"Dot product shape mismatch, \(4,\) vs \(3,\)"
475
# exception raised is of type Exception
476
with pytest.raises(Exception, match=msg):
477
a.dot(a.values[:3])
0 commit comments