Skip to content

Commit 82b9b05

Browse files
akinomyogascop
andcommitted
test(python): use descriptive test name
Co-authored-by: Ville Skyttä <[email protected]>
1 parent a1ba42a commit 82b9b05

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

test/t/test_python.py

+26-7
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,41 @@ def test_9(self, completion):
4646
def test_bb(self, completion):
4747
assert "-bb" in completion
4848

49+
@pytest.mark.complete("python foo ", cwd="python")
50+
def test_script_args(self, completion):
51+
assert "bar.txt" in completion
52+
53+
@pytest.mark.complete("python -- foo ", cwd="python")
54+
def test_script_args_with_double_hyphen(self, completion):
55+
assert "bar.txt" in completion
56+
4957
@pytest.mark.complete("python -m foo bar -p ", cwd="python")
50-
def test_script_args_1(self, completion):
58+
def test_module_args(self, completion):
5159
assert "bar.txt" in completion
5260

53-
@pytest.mark.complete("python -mfoo bar -p ", cwd="python")
54-
def test_script_args_2(self, completion):
61+
@pytest.mark.complete("python foo bar -p ", cwd="python")
62+
def test_script_args_after_option(self, completion):
5563
assert "bar.txt" in completion
5664

57-
@pytest.mark.complete("python -- foo ", cwd="python")
58-
def test_script_args_3(self, completion):
65+
@pytest.mark.complete("python -- foo bar -p ", cwd="python")
66+
def test_script_args_after_option_with_double_hyphen(self, completion):
67+
assert "bar.txt" in completion
68+
69+
@pytest.mark.complete("python -m foo bar -p ", cwd="python")
70+
def test_module_args_after_option(self, completion):
71+
assert "bar.txt" in completion
72+
73+
@pytest.mark.complete("python -mfoo bar -p ", cwd="python")
74+
def test_module_args_after_option_with_connected_m_arg(self, completion):
5975
assert "bar.txt" in completion
6076

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

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

0 commit comments

Comments
 (0)