Skip to content

Commit 0170fa0

Browse files
authored
TST: suppress deprecation messages in doc tests for Index.is_foo (#51212)
* DOC: suppress deprecation messages in doc tests in Index.is_* * DOC: fix issue
1 parent 7e88122 commit 0170fa0

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

pandas/core/indexes/base.py

+24-24
Original file line numberDiff line numberDiff line change
@@ -2268,15 +2268,15 @@ def is_boolean(self) -> bool:
22682268
Examples
22692269
--------
22702270
>>> idx = pd.Index([True, False, True])
2271-
>>> idx.is_boolean()
2271+
>>> idx.is_boolean() # doctest: +SKIP
22722272
True
22732273
22742274
>>> idx = pd.Index(["True", "False", "True"])
2275-
>>> idx.is_boolean()
2275+
>>> idx.is_boolean() # doctest: +SKIP
22762276
False
22772277
22782278
>>> idx = pd.Index([True, False, "True"])
2279-
>>> idx.is_boolean()
2279+
>>> idx.is_boolean() # doctest: +SKIP
22802280
False
22812281
"""
22822282
warnings.warn(
@@ -2312,15 +2312,15 @@ def is_integer(self) -> bool:
23122312
Examples
23132313
--------
23142314
>>> idx = pd.Index([1, 2, 3, 4])
2315-
>>> idx.is_integer()
2315+
>>> idx.is_integer() # doctest: +SKIP
23162316
True
23172317
23182318
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
2319-
>>> idx.is_integer()
2319+
>>> idx.is_integer() # doctest: +SKIP
23202320
False
23212321
23222322
>>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
2323-
>>> idx.is_integer()
2323+
>>> idx.is_integer() # doctest: +SKIP
23242324
False
23252325
"""
23262326
warnings.warn(
@@ -2360,19 +2360,19 @@ def is_floating(self) -> bool:
23602360
Examples
23612361
--------
23622362
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
2363-
>>> idx.is_floating()
2363+
>>> idx.is_floating() # doctest: +SKIP
23642364
True
23652365
23662366
>>> idx = pd.Index([1.0, 2.0, np.nan, 4.0])
2367-
>>> idx.is_floating()
2367+
>>> idx.is_floating() # doctest: +SKIP
23682368
True
23692369
23702370
>>> idx = pd.Index([1, 2, 3, 4, np.nan])
2371-
>>> idx.is_floating()
2371+
>>> idx.is_floating() # doctest: +SKIP
23722372
True
23732373
23742374
>>> idx = pd.Index([1, 2, 3, 4])
2375-
>>> idx.is_floating()
2375+
>>> idx.is_floating() # doctest: +SKIP
23762376
False
23772377
"""
23782378
warnings.warn(
@@ -2408,23 +2408,23 @@ def is_numeric(self) -> bool:
24082408
Examples
24092409
--------
24102410
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
2411-
>>> idx.is_numeric()
2411+
>>> idx.is_numeric() # doctest: +SKIP
24122412
True
24132413
24142414
>>> idx = pd.Index([1, 2, 3, 4.0])
2415-
>>> idx.is_numeric()
2415+
>>> idx.is_numeric() # doctest: +SKIP
24162416
True
24172417
24182418
>>> idx = pd.Index([1, 2, 3, 4])
2419-
>>> idx.is_numeric()
2419+
>>> idx.is_numeric() # doctest: +SKIP
24202420
True
24212421
24222422
>>> idx = pd.Index([1, 2, 3, 4.0, np.nan])
2423-
>>> idx.is_numeric()
2423+
>>> idx.is_numeric() # doctest: +SKIP
24242424
True
24252425
24262426
>>> idx = pd.Index([1, 2, 3, 4.0, np.nan, "Apple"])
2427-
>>> idx.is_numeric()
2427+
>>> idx.is_numeric() # doctest: +SKIP
24282428
False
24292429
"""
24302430
warnings.warn(
@@ -2460,20 +2460,20 @@ def is_object(self) -> bool:
24602460
Examples
24612461
--------
24622462
>>> idx = pd.Index(["Apple", "Mango", "Watermelon"])
2463-
>>> idx.is_object()
2463+
>>> idx.is_object() # doctest: +SKIP
24642464
True
24652465
24662466
>>> idx = pd.Index(["Apple", "Mango", 2.0])
2467-
>>> idx.is_object()
2467+
>>> idx.is_object() # doctest: +SKIP
24682468
True
24692469
24702470
>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
24712471
... "Watermelon"]).astype("category")
2472-
>>> idx.is_object()
2472+
>>> idx.is_object() # doctest: +SKIP
24732473
False
24742474
24752475
>>> idx = pd.Index([1.0, 2.0, 3.0, 4.0])
2476-
>>> idx.is_object()
2476+
>>> idx.is_object() # doctest: +SKIP
24772477
False
24782478
"""
24792479
warnings.warn(
@@ -2511,11 +2511,11 @@ def is_categorical(self) -> bool:
25112511
--------
25122512
>>> idx = pd.Index(["Watermelon", "Orange", "Apple",
25132513
... "Watermelon"]).astype("category")
2514-
>>> idx.is_categorical()
2514+
>>> idx.is_categorical() # doctest: +SKIP
25152515
True
25162516
25172517
>>> idx = pd.Index([1, 3, 5, 7])
2518-
>>> idx.is_categorical()
2518+
>>> idx.is_categorical() # doctest: +SKIP
25192519
False
25202520
25212521
>>> s = pd.Series(["Peter", "Victor", "Elisabeth", "Mar"])
@@ -2525,7 +2525,7 @@ def is_categorical(self) -> bool:
25252525
2 Elisabeth
25262526
3 Mar
25272527
dtype: object
2528-
>>> s.index.is_categorical()
2528+
>>> s.index.is_categorical() # doctest: +SKIP
25292529
False
25302530
"""
25312531
warnings.warn(
@@ -2564,11 +2564,11 @@ def is_interval(self) -> bool:
25642564
--------
25652565
>>> idx = pd.Index([pd.Interval(left=0, right=5),
25662566
... pd.Interval(left=5, right=10)])
2567-
>>> idx.is_interval()
2567+
>>> idx.is_interval() # doctest: +SKIP
25682568
True
25692569
25702570
>>> idx = pd.Index([1, 3, 5, 7])
2571-
>>> idx.is_interval()
2571+
>>> idx.is_interval() # doctest: +SKIP
25722572
False
25732573
"""
25742574
warnings.warn(

0 commit comments

Comments
 (0)