summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-09-07 14:37:50 -0700
committerAnthony Sottile <asottile@umich.edu>2019-09-07 14:37:50 -0700
commit8c4e42afaa3b25683be167d9b4ac28f8d7d25a4b (patch)
treefebdecfc51fdc956b2582f509f8fabd146a44def /tests
parent8cd1e0ecc7b137ce9d6aaf074a5f93024269174d (diff)
downloadflake8-8c4e42afaa3b25683be167d9b4ac28f8d7d25a4b.tar.gz
Type annotate flake8.options.manager
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_option.py4
-rw-r--r--tests/unit/test_option_manager.py11
2 files changed, 3 insertions, 12 deletions
diff --git a/tests/unit/test_option.py b/tests/unit/test_option.py
index d4607b3..ba6b672 100644
--- a/tests/unit/test_option.py
+++ b/tests/unit/test_option.py
@@ -28,7 +28,7 @@ def test_to_argparse():
def test_to_optparse():
"""Test that .to_optparse() produces a useful error message."""
with pytest.raises(AttributeError) as excinfo:
- manager.Option('--foo').to_optparse()
+ manager.Option('--foo').to_optparse
msg, = excinfo.value.args
assert msg == 'to_optparse: flake8 now uses argparse'
@@ -58,4 +58,4 @@ def test_config_name_needs_long_option_name():
def test_dest_is_not_overridden():
"""Show that we do not override custom destinations."""
opt = manager.Option('-s', '--short', dest='something_not_short')
- assert opt.dest == 'something_not_short' # type: ignore
+ assert opt.dest == 'something_not_short'
diff --git a/tests/unit/test_option_manager.py b/tests/unit/test_option_manager.py
index 859dca1..b384a31 100644
--- a/tests/unit/test_option_manager.py
+++ b/tests/unit/test_option_manager.py
@@ -52,7 +52,7 @@ def test_add_option_long_option_only(optmanager):
assert optmanager.config_options_dict == {}
optmanager.add_option('--long', help='Test long opt')
- assert optmanager.options[0].short_option_name is manager._NOARG
+ assert optmanager.options[0].short_option_name is manager._ARG.NO
assert optmanager.options[0].long_option_name == '--long'
@@ -133,15 +133,6 @@ def test_parse_args_normalize_paths(optmanager):
]
-def test_format_plugin():
- """Verify that format_plugin turns a tuple into a dictionary."""
- plugin = manager.OptionManager.format_plugin(
- manager.PluginVersion('Testing', '0.0.0', False)
- )
- assert plugin['name'] == 'Testing'
- assert plugin['version'] == '0.0.0'
-
-
def test_generate_versions(optmanager):
"""Verify a comma-separated string is generated of registered plugins."""
optmanager.registered_plugins = [