Skip to content

Commit

Permalink
optparse compatibility - add float and complex
Browse files Browse the repository at this point in the history
also documents the implementation quality
fixes pytest-dev#457
  • Loading branch information
RonnyPfannschmidt committed Jul 19, 2016
1 parent 2b99738 commit 317b3f2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,18 @@ def __str__(self):


class Argument:
"""class that mimics the necessary behaviour of optparse.Option """
"""class that mimics the necessary behaviour of optparse.Option
its currently a least effort implementation
and ignoring choices and integer prefixes
https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
"""
_typ_map = {
'int': int,
'string': str,
}
'float': float,
'complex': complex,
}
# enable after some grace period for plugin writers
TYPE_WARN = False

Expand Down

0 comments on commit 317b3f2

Please sign in to comment.