diff options
author | Devaev Maxim <[email protected]> | 2021-07-08 16:52:51 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-07-08 16:52:51 +0300 |
commit | 7c68b6b406b1ab864b832be814458a93717ce908 (patch) | |
tree | dd9ea3b93a76fdae365b88afa746754d95fe2d16 | |
parent | 43aa435b81980ff5bc7a4b6ccacebde9d4ee2167 (diff) |
lint fixes
-rw-r--r-- | kvmd/plugins/msd/otg/__init__.py | 2 | ||||
-rw-r--r-- | testenv/linters/pylint.ini | 1 | ||||
-rw-r--r-- | testenv/tests/apps/cleanup/test_main.py | 4 | ||||
-rw-r--r-- | testenv/tests/apps/htpasswd/test_main.py | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/kvmd/plugins/msd/otg/__init__.py b/kvmd/plugins/msd/otg/__init__.py index 9a741a88..bb5129a3 100644 --- a/kvmd/plugins/msd/otg/__init__.py +++ b/kvmd/plugins/msd/otg/__init__.py @@ -539,7 +539,7 @@ class Plugin(BaseMsd): # pylint: disable=too-many-instance-attributes def __set_image_complete(self, name: str, flag: bool) -> None: path = os.path.join(self.__meta_path, name + ".complete") if flag: - open(path, "w").close() + open(path, "w").close() # pylint: disable=consider-using-with else: if os.path.exists(path): os.remove(path) diff --git a/testenv/linters/pylint.ini b/testenv/linters/pylint.ini index b2471ffe..f086a1b5 100644 --- a/testenv/linters/pylint.ini +++ b/testenv/linters/pylint.ini @@ -35,6 +35,7 @@ disable = raise-missing-from, consider-using-in, unsubscriptable-object, + unused-private-member, # https://github.com/PyCQA/pylint/issues/3882 [CLASSES] diff --git a/testenv/tests/apps/cleanup/test_main.py b/testenv/tests/apps/cleanup/test_main.py index 8458d03f..c1c829f0 100644 --- a/testenv/tests/apps/cleanup/test_main.py +++ b/testenv/tests/apps/cleanup/test_main.py @@ -37,9 +37,9 @@ def test_ok(tmpdir) -> None: # type: ignore queue: "multiprocessing.Queue[Literal[True]]" = multiprocessing.Queue() ustreamer_sock_path = os.path.abspath(str(tmpdir.join("ustreamer-fake.sock"))) - open(ustreamer_sock_path, "w").close() + open(ustreamer_sock_path, "w").close() # pylint: disable=consider-using-with kvmd_sock_path = os.path.abspath(str(tmpdir.join("kvmd-fake.sock"))) - open(kvmd_sock_path, "w").close() + open(kvmd_sock_path, "w").close() # pylint: disable=consider-using-with def ustreamer_fake() -> None: setproctitle.setproctitle("kvmd/streamer: /usr/bin/ustreamer") diff --git a/testenv/tests/apps/htpasswd/test_main.py b/testenv/tests/apps/htpasswd/test_main.py index 4b1ee66b..54f30047 100644 --- a/testenv/tests/apps/htpasswd/test_main.py +++ b/testenv/tests/apps/htpasswd/test_main.py @@ -164,7 +164,7 @@ def test_fail__unknown_plugin() -> None: def test_fail__invalid_passwd(mocker, tmpdir) -> None: # type: ignore path = os.path.abspath(str(tmpdir.join("htpasswd"))) - open(path, "w").close() + open(path, "w").close() # pylint: disable=consider-using-with mocker.patch.object(builtins, "input", (lambda: "\n")) with pytest.raises(SystemExit, match="The argument is not a valid passwd characters"): _run_htpasswd(["set", "admin", "--read-stdin"], path) |