mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-10 06:44:18 +00:00
Added tests for optparse's 'float' and 'complex' types
This commit is contained in:
parent
6341d1382e
commit
ccd9beb26d
1 changed files with 8 additions and 0 deletions
|
|
@ -23,6 +23,14 @@ def test_to_optparse():
|
||||||
assert optparse_opt.action == 'count'
|
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')
|
@mock.patch('optparse.Option')
|
||||||
def test_to_optparse_creates_an_option_as_we_expect(Option): # noqa: N803
|
def test_to_optparse_creates_an_option_as_we_expect(Option): # noqa: N803
|
||||||
"""Show that we pass all keyword args to optparse.Option."""
|
"""Show that we pass all keyword args to optparse.Option."""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue