diff options
| author | ymdatta <ymdatta@protonmail.com> | 2018-10-28 22:16:03 +0530 |
|---|---|---|
| committer | ymdatta <ymdatta@protonmail.com> | 2018-10-28 22:16:03 +0530 |
| commit | ccd9beb26dac68ada62d3c5fd58c0e4ffa3d79c3 (patch) | |
| tree | 7f72baf7b5d5a6933085d437bb1628d5b5301b2d /tests | |
| parent | 6341d1382e0ab14043396e8a9fbb18c27a3e236c (diff) | |
| download | flake8-ccd9beb26dac68ada62d3c5fd58c0e4ffa3d79c3.tar.gz | |
Added tests for optparse's 'float' and 'complex' types
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/unit/test_option.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/test_option.py b/tests/unit/test_option.py index 76b4341..7c90512 100644 --- a/tests/unit/test_option.py +++ b/tests/unit/test_option.py @@ -23,6 +23,14 @@ def test_to_optparse(): assert optparse_opt.action == 'count' +def test_to_support_optparses_standard_types(): + """Show that optparse converts float and complex types correctly.""" + opt = manager.Option('-t', '--test') + + assert type(opt.normalize_from_setuptools(float(2))) == float + assert type(opt.normalize_from_setuptools(complex(2))) == complex + + @mock.patch('optparse.Option') def test_to_optparse_creates_an_option_as_we_expect(Option): # noqa: N803 """Show that we pass all keyword args to optparse.Option.""" |
