Skip to content

Commit

Permalink
test: Pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Aug 12, 2018
1 parent 3f84586 commit 1389110
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/generate
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cat <<EOF >t/test_$file.py
import pytest
$marker
class Test$name(object):
class Test$name:
@pytest.mark.complete("$1 $arg")
def test_1(self, completion):
Expand Down
4 changes: 2 additions & 2 deletions test/t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def diff_env(before: List[str], after: List[str], ignore: str):


def assert_complete(
request, bash: pexpect.spawn, cmd: str, **kwargs) -> CompletionResult:
bash: pexpect.spawn, cmd: str, **kwargs) -> CompletionResult:
skipif = kwargs.get("skipif")
if skipif:
try:
Expand Down Expand Up @@ -321,4 +321,4 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult:
marker = request.node.get_marker("complete")
if not marker:
return CompletionResult("", [])
return assert_complete(request, bash, marker.args[0], **marker.kwargs)
return assert_complete(bash, marker.args[0], **marker.kwargs)
6 changes: 3 additions & 3 deletions test/t/test_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_1(self, completion):
def test_2(self, completion):
assert completion.list

def test_3(self, request, bash):
def test_3(self, bash):
"""~part should complete to ~full<SPACE> if home dir does not exist."""
res = assert_bash_exec(
bash, "for u in $(compgen -u); do "
Expand All @@ -26,6 +26,6 @@ def test_3(self, request, bash):
pytest.skip("No suitable test user found")
return
part, full = part_full
completion = assert_complete(request, bash, "ls ~%s" % part)
assert len(completion.list) == 1
completion = assert_complete(bash, "ls ~%s" % part)
assert completion.list == ["~%s" % full]
assert completion.line.endswith(" ")
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_count_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+args=")
class TestUnitCountArgs(object):
class TestUnitCountArgs:

def test_1(self, bash):
assert_bash_exec(bash, "_count_args >/dev/null")
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None)
class TestUnitExpand(object):
class TestUnitExpand:

def test_1(self, bash):
assert_bash_exec(bash, "_expand >/dev/null")
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_expand_tilde_by_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None)
class TestUnitExpandTildeByRef(object):
class TestUnitExpandTildeByRef:

def test_1(self, bash):
assert_bash_exec(bash, "__expand_tilde_by_ref >/dev/null")
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_filedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitFiledir(object):
class TestUnitFiledir:

def test_1(self, bash):
assert_bash_exec(bash, "_filedir >/dev/null")
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_find_unique_completion_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None)
class TestUnitFindUniqueCompletionPair(object):
class TestUnitFindUniqueCompletionPair:

def _test(self, inp: str, exp: str) -> None:
res = find_unique_completion_pair(inp.split())
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_get_comp_words_by_ref.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@pytest.mark.bashcomp(
cmd=None, ignore_env=r"^(\+(cur|prev)|[+-]COMP_(WORDS|CWORD|LINE|POINT))=")
class TestUnitGetCompWordsByRef(object):
class TestUnitGetCompWordsByRef:

def _test(self, bash,
comp_words, comp_cword, comp_line, comp_point, args=""):
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_get_cword.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@pytest.mark.bashcomp(cmd=None,
ignore_env=r"^[+-]COMP_(WORDS|CWORD|LINE|POINT)=")
class TestUnitGetCword(object):
class TestUnitGetCword:

def _test(self, bash,
comp_words, comp_cword, comp_line, comp_point, arg=""):
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_init_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitInitCompletion(object):
class TestUnitInitCompletion:

def test_1(self, bash):
"""Test environment non-pollution, detected at teardown."""
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_ip_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitIpAddresses(object):
class TestUnitIpAddresses:

def test_1(self, bash):
assert_bash_exec(bash, "_ip_addresses")
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_parse_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+declare -f fn$")
class TestUnitParseHelp(object):
class TestUnitParseHelp:

def test_1(self, bash):
assert_bash_exec(bash, "fn() { echo; }")
Expand Down
2 changes: 1 addition & 1 deletion test/t/unit/test_unit_parse_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+declare -f fn$")
class TestUnitParseUsage(object):
class TestUnitParseUsage:

def test_1(self, bash):
assert_bash_exec(bash, "fn() { echo; }")
Expand Down
4 changes: 2 additions & 2 deletions test/t/unit/test_unit_tilde.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitTilde(object):
class TestUnitTilde:

@pytest.fixture
def part_full(self, bash):
Expand Down Expand Up @@ -40,7 +40,7 @@ def _test_part_full(self, bash, part, full):

def test_4(self, bash, part_full):
"""~full should complete to ~full unmodified."""
part, full = part_full
_, full = part_full
self._test_part_full(bash, full, full)

def test_5(self, bash, part_full):
Expand Down

0 comments on commit 1389110

Please sign in to comment.