Don't display unnecessary help, fixes #1557

This commit is contained in:
Dave Halter
2020-04-26 00:21:01 +02:00
parent e6d8a955d2
commit 97fb95ec0c
2 changed files with 23 additions and 2 deletions

View File

@@ -120,3 +120,13 @@ def test_docstring_decorator(goto_or_help_or_infer, skip_python2):
@pytest.mark.parametrize('code', ['', '\n', ' '])
def test_empty(Script, code):
assert not Script(code).help(1, 0)
@pytest.mark.parametrize('code', ['f()', '(bar or baz)', 'f[3]'])
def test_no_help_for_operator(Script, code):
assert not Script(code).help()
@pytest.mark.parametrize('code', ['()', '(1,)', '[]', '[1]', 'f[]'])
def test_help_for_operator(Script, code):
assert Script(code).help()