Skip to content

Commit

Permalink
test(python): use descriptive test name
Browse files Browse the repository at this point in the history
Co-authored-by: Ville Skyttä <[email protected]>
  • Loading branch information
akinomyoga and scop committed Aug 6, 2023
1 parent a1ba42a commit 82b9b05
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions test/t/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,41 @@ def test_9(self, completion):
def test_bb(self, completion):
assert "-bb" in completion

@pytest.mark.complete("python foo ", cwd="python")
def test_script_args(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -- foo ", cwd="python")
def test_script_args_with_double_hyphen(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -m foo bar -p ", cwd="python")
def test_script_args_1(self, completion):
def test_module_args(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -mfoo bar -p ", cwd="python")
def test_script_args_2(self, completion):
@pytest.mark.complete("python foo bar -p ", cwd="python")
def test_script_args_after_option(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -- foo ", cwd="python")
def test_script_args_3(self, completion):
@pytest.mark.complete("python -- foo bar -p ", cwd="python")
def test_script_args_after_option_with_double_hyphen(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -m foo bar -p ", cwd="python")
def test_module_args_after_option(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -mfoo bar -p ", cwd="python")
def test_module_args_after_option_with_connected_m_arg(self, completion):
assert "bar.txt" in completion

@pytest.mark.complete("python -- ", cwd="python")
def test_script_args_4(self, completion):
def test_script_name(self, completion):
assert "bar.txt" not in completion

@pytest.mark.complete("python -W -mfoo ", cwd="python")
def test_script_args_5(self, completion):
def test_fake_module_args_with_w_arg(self, completion):
"""In this case, -mfoo looks like an option to specify the module, but
it should not be treated as the module name because it is an option
argument to -W."""
assert "bar.txt" not in completion

0 comments on commit 82b9b05

Please sign in to comment.