diff --git a/test/unit/test_main.py b/test/unit/test_main.py
index 672986aa..e54b2f23 100644
--- a/test/unit/test_main.py
+++ b/test/unit/test_main.py
@@ -438,16 +438,14 @@ def test_tuxmake_directory(tmp_path, run):
tuxmake_build = tmp_path / "build"
tuxmake_build.mkdir()
- (tuxmake_build / "metadata.json").write_text(
- """
+ (tuxmake_build / "metadata.json").write_text("""
{
"results": {
"artifacts": {"kernel": ["bzImage"], "modules": ["modules.tar.xz"]}
},
"build": {"target_arch": "x86_64"}
}
- """
- )
+ """)
tux = tuxmake_directory(tuxmake_build)
assert tux.kernel == f"file://{tuxmake_build}/bzImage"
@@ -461,16 +459,14 @@ def test_no_modules(tmp_path):
tuxmake_build = tmp_path / "build"
tuxmake_build.mkdir()
- (tuxmake_build / "metadata.json").write_text(
- """
+ (tuxmake_build / "metadata.json").write_text("""
{
"results": {
"artifacts": {"kernel": ["bzImage"]}
},
"build": {"target_arch": "x86_64"}
}
- """
- )
+ """)
tux = tuxmake_directory(tuxmake_build)
assert tux.modules == []
@@ -614,9 +610,7 @@ def test_update_cache(mocker, monkeypatch, capsys):
with pytest.raises(SystemExit):
main()
stdout, stderr = capsys.readouterr()
- assert (
- stdout
- == """Updating local cache:
+ assert stdout == """Updating local cache:
* Rootfs:
* avh-imx93
* avh-rpi4b
@@ -643,7 +637,6 @@ def test_update_cache(mocker, monkeypatch, capsys):
* qemu-x86_64
* Test definitions
"""
- )
def test_save_results_json(tuxrun_args, lava_run, mocker, tmp_path):
diff --git a/test/unit/test_writer.py b/test/unit/test_writer.py
index 8b05ca7f..d2e341bc 100644
--- a/test/unit/test_writer.py
+++ b/test/unit/test_writer.py
@@ -15,9 +15,7 @@ def test_write_log_file(tmp_path):
encoding="utf-8"
) == '{"lvl": "info", "msg": "Hello, world", "dt": "2021-04-08T18:42:25.139513"}\n'
- assert (
- html_file.read_text(encoding="utf-8")
- == """
+ assert html_file.read_text(encoding="utf-8") == """
TuxTest log
@@ -40,7 +38,6 @@ def test_write_log_file(tmp_path):
"""
- )
assert text_file.read_text(encoding="utf-8") == ""
@@ -70,9 +67,7 @@ def test_write_stdout_logs(capsys, tmp_path):
yaml_file.read_text(encoding="utf-8")
== """- {"lvl": "info", "msg": "Hello, world", "dt": "2021-04-08T18:42:25.139513"}\n"""
)
- assert (
- html_file.read_text(encoding="utf-8")
- == """
+ assert html_file.read_text(encoding="utf-8") == """
TuxTest log
@@ -95,7 +90,6 @@ def test_write_stdout_logs(capsys, tmp_path):
"""
- )
assert text_file.read_text(encoding="utf-8") == ""
@@ -125,9 +119,7 @@ def test_write_stdout_feedback_logs(capsys, tmp_path):
yaml_file.read_text(encoding="utf-8")
== """- {"lvl": "feedback", "msg": "Hello, world", "dt": "2021-04-08T18:42:25.139513", "ns": "testing"}\n"""
)
- assert (
- html_file.read_text(encoding="utf-8")
- == """
+ assert html_file.read_text(encoding="utf-8") == """
TuxTest log
@@ -151,7 +143,6 @@ def test_write_stdout_feedback_logs(capsys, tmp_path):
"""
- )
assert text_file.read_text(encoding="utf-8") == " Hello, world\n"
@@ -164,14 +155,11 @@ def test_writer_invalid_yaml(capsys, tmpdir):
writer.write(data)
writer.write("{hello: world}")
out, err = capsys.readouterr()
- assert (
- out
- == """{
+ assert out == """{
hello world
{}
{hello: world}
"""
- )
assert err == ""
assert (tmpdir / "logs").read_text(
encoding="utf-8"
diff --git a/tuxrun/__init__.py b/tuxrun/__init__.py
index 9ff2672d..6e92d2eb 100644
--- a/tuxrun/__init__.py
+++ b/tuxrun/__init__.py
@@ -7,4 +7,5 @@
"""
Command line tool for testing Linux under QEMU
"""
+
__version__ = "1.4.0"
diff --git a/tuxrun/__main__.py b/tuxrun/__main__.py
index ad00dca0..c4fc856f 100644
--- a/tuxrun/__main__.py
+++ b/tuxrun/__main__.py
@@ -294,7 +294,7 @@ def run(options, tmpdir: Path, cache_dir: Optional[Path], artefacts: dict) -> in
] + extra_assets:
ro = True
if isinstance(path, tuple):
- (path, ro) = path
+ path, ro = path
if not path:
continue
if urlparse(path).scheme == "file":
diff --git a/tuxrun/runtimes.py b/tuxrun/runtimes.py
index ac87bd1e..9aed83b8 100644
--- a/tuxrun/runtimes.py
+++ b/tuxrun/runtimes.py
@@ -125,7 +125,7 @@ def cmd(self, args):
srcs = set()
dsts = set()
for binding in self.__bindings__:
- (src, dst, ro, device) = binding
+ src, dst, ro, device = binding
if src in srcs:
LOG.error("Duplicated mount source %r", src)
raise Exception("Duplicated mount source %r" % src)
diff --git a/tuxrun/templates/__init__.py b/tuxrun/templates/__init__.py
index 86a8efe3..ec6f60e3 100644
--- a/tuxrun/templates/__init__.py
+++ b/tuxrun/templates/__init__.py
@@ -9,7 +9,6 @@
import jinja2
-
BASE = (Path(__file__) / "..").resolve()
diff --git a/tuxrun/utils.py b/tuxrun/utils.py
index 2c676060..0140b4f9 100644
--- a/tuxrun/utils.py
+++ b/tuxrun/utils.py
@@ -18,7 +18,6 @@
from tuxrun import requests, xdg
from tuxrun.yaml import yaml_load
-
DEFAULT_DISPATCHER_DOWNLOAD_DIR = "/var/lib/lava/dispatcher/tmp"