aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-01-26 11:03:13 +0200
committerArthur Zamarin <arthurzam@gentoo.org>2024-01-26 11:03:13 +0200
commit21b0291a014d17bc4681ae66b0d900c96279fc53 (patch)
tree318c09ca9ab005c2e1ed0a7b6f965e10a6878e08 /tests
parentauthors: Add myself to the list. (diff)
downloadsnakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.tar.gz
snakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.tar.bz2
snakeoil-21b0291a014d17bc4681ae66b0d900c96279fc53.zip
reformat with black 24
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/test_arghparse.py7
-rw-r--r--tests/test_osutils.py7
-rw-r--r--tests/test_version.py21
3 files changed, 20 insertions, 15 deletions
diff --git a/tests/cli/test_arghparse.py b/tests/cli/test_arghparse.py
index d0db449e..c55e786f 100644
--- a/tests/cli/test_arghparse.py
+++ b/tests/cli/test_arghparse.py
@@ -284,9 +284,10 @@ class ParseStdinTest(BaseArgparseOptions):
(["foo", "bar", "baz"], ["foo", "bar", "baz"]),
(["\nfoo\n", " bar ", "\nbaz"], ["\nfoo", " bar", "\nbaz"]),
):
- with mock.patch("sys.stdin") as stdin, mock.patch(
- "builtins.open", mock.mock_open()
- ) as mock_file:
+ with (
+ mock.patch("sys.stdin") as stdin,
+ mock.patch("builtins.open", mock.mock_open()) as mock_file,
+ ):
stdin.readlines.return_value = readlines
stdin.isatty.return_value = False
namespace = self.parser.parse_args(["-"])
diff --git a/tests/test_osutils.py b/tests/test_osutils.py
index 82959fe4..5b5e7427 100644
--- a/tests/test_osutils.py
+++ b/tests/test_osutils.py
@@ -141,9 +141,10 @@ class TestEnsureDirs:
path.mkdir()
path.chmod(0o750)
- with mock.patch("snakeoil.osutils.os.chmod") as chmod, mock.patch(
- "snakeoil.osutils.os.chown"
- ) as chown:
+ with (
+ mock.patch("snakeoil.osutils.os.chmod") as chmod,
+ mock.patch("snakeoil.osutils.os.chown") as chown,
+ ):
chmod.side_effect = OSError(5, "Input/output error")
# chmod failure when file exists and trying to reset perms to match
diff --git a/tests/test_version.py b/tests/test_version.py
index 09927542..23118b36 100644
--- a/tests/test_version.py
+++ b/tests/test_version.py
@@ -23,9 +23,10 @@ class TestVersion:
assert v.startswith("snakeoil 9.9.9")
def test_get_version_git_dev(self):
- with mock.patch("snakeoil.version.import_module") as import_module, mock.patch(
- "snakeoil.version.get_git_version"
- ) as get_git_version:
+ with (
+ mock.patch("snakeoil.version.import_module") as import_module,
+ mock.patch("snakeoil.version.get_git_version") as get_git_version,
+ ):
import_module.side_effect = ImportError
verinfo = {
"rev": "1ff76b021d208f7df38ac524537b6419404f1c64",
@@ -57,9 +58,10 @@ class TestVersion:
assert result == f"snakeoil {verinfo['tag']} -- released {verinfo['date']}"
def test_get_version_no_git_version(self):
- with mock.patch("snakeoil.version.import_module") as import_module, mock.patch(
- "snakeoil.version.get_git_version"
- ) as get_git_version:
+ with (
+ mock.patch("snakeoil.version.import_module") as import_module,
+ mock.patch("snakeoil.version.get_git_version") as get_git_version,
+ ):
import_module.side_effect = ImportError
get_git_version.return_value = None
result = version.get_version("snakeoil", "nonexistent", __version__)
@@ -113,9 +115,10 @@ class TestGitVersion:
assert result == expected
def test_get_git_version_good_tag(self):
- with mock.patch("snakeoil.version._run_git") as run_git, mock.patch(
- "snakeoil.version._get_git_tag"
- ) as get_git_tag:
+ with (
+ mock.patch("snakeoil.version._run_git") as run_git,
+ mock.patch("snakeoil.version._get_git_tag") as get_git_tag,
+ ):
# tagged, release version
run_git.return_value = (
b"1ff76b021d208f7df38ac524537b6419404f1c64\nMon Sep 25 13:50:24 2017 -0400",