File tree Expand file tree Collapse file tree 2 files changed +0
-18
lines changed Expand file tree Collapse file tree 2 files changed +0
-18
lines changed Original file line number Diff line number Diff line change 2
2
import math
3
3
import operator
4
4
import re
5
- import warnings
6
5
from abc import ABC , abstractmethod
7
6
from collections .abc import Iterable
8
7
from inspect import signature
@@ -587,20 +586,9 @@ def __init__(self):
587
586
self ._constraints = [
588
587
_InstancesOf (bool ),
589
588
_InstancesOf (np .bool_ ),
590
- _InstancesOf (Integral ),
591
589
]
592
590
593
591
def is_satisfied_by (self , val ):
594
- # TODO(1.4) remove support for Integral.
595
- if isinstance (val , Integral ) and not isinstance (val , bool ):
596
- warnings .warn (
597
- (
598
- "Passing an int for a boolean parameter is deprecated in version"
599
- " 1.2 and won't be supported anymore in version 1.4."
600
- ),
601
- FutureWarning ,
602
- )
603
-
604
592
return any (c .is_satisfied_by (val ) for c in self ._constraints )
605
593
606
594
def __str__ (self ):
Original file line number Diff line number Diff line change @@ -627,12 +627,6 @@ def f(param):
627
627
f (True )
628
628
f (np .bool_ (False ))
629
629
630
- # an int is also valid but deprecated
631
- with pytest .warns (
632
- FutureWarning , match = "Passing an int for a boolean parameter is deprecated"
633
- ):
634
- f (1 )
635
-
636
630
637
631
def test_no_validation ():
638
632
"""Check that validation can be skipped for a parameter."""
You can’t perform that action at this time.
0 commit comments