From 317b3f257da727419118b8c8bd5e3280dd47e8c0 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 19 Jul 2016 10:20:41 +0200 Subject: [PATCH] optparse compatibility - add float and complex also documents the implementation quality fixes #457 --- _pytest/config.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index 68a3dafbe0d..17d0837cc58 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -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