Skip to content

Commit 317b3f2

Browse files
optparse compatibility - add float and complex
also documents the implementation quality fixes #457
1 parent 2b99738 commit 317b3f2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

_pytest/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,18 @@ def __str__(self):
552552

553553

554554
class Argument:
555-
"""class that mimics the necessary behaviour of optparse.Option """
555+
"""class that mimics the necessary behaviour of optparse.Option
556+
557+
its currently a least effort implementation
558+
and ignoring choices and integer prefixes
559+
https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
560+
"""
556561
_typ_map = {
557562
'int': int,
558563
'string': str,
559-
}
564+
'float': float,
565+
'complex': complex,
566+
}
560567
# enable after some grace period for plugin writers
561568
TYPE_WARN = False
562569

0 commit comments

Comments
 (0)