diff --git a/.github/workflows/pytests.yml b/.github/workflows/pytests.yml index 20defc2..4c600f6 100644 --- a/.github/workflows/pytests.yml +++ b/.github/workflows/pytests.yml @@ -28,8 +28,6 @@ jobs: sudo wget -O /usr/bin/zot https://github.com/project-zot/zot/releases/download/v2.1.0/zot-linux-amd64 sudo chmod +x /usr/bin/zot sudo chown root:root /usr/bin/zot - - name: serve zot - run: zot serve zot/config.json - name: Run tests with pytest - run: poetry run pytest + run: poetry run pytest -s diff --git a/tests/test_push_image.py b/tests/test_push_image.py index 5daf1fb..627eaf4 100644 --- a/tests/test_push_image.py +++ b/tests/test_push_image.py @@ -20,6 +20,8 @@ def write_zot_config(config_dict, file_path): with open(file_path, "w") as config_file: json.dump(config_dict, config_file, indent=4) + +@pytest.fixture(autouse=True) def setup_test_environment(): zot_config = { "distSpecVersion": "1.1.0", @@ -31,6 +33,7 @@ def setup_test_environment(): with tempfile.NamedTemporaryFile(delete=False, suffix=".json") as temp_config_file: write_zot_config(zot_config, temp_config_file.name) zot_config_file_path = temp_config_file.name + print(f"Spawning zot registry with config {zot_config_file_path}") zot_process = spawn_background_process( f"zot serve {zot_config_file_path}", @@ -40,20 +43,6 @@ def setup_test_environment(): yield zot_process - if zot_process.stdout: - print("Zot stdout:") - for line in io.TextIOWrapper(zot_process.stdout, encoding="utf-8"): - print(line) - else: - print("Not capture any zot stdout") - - if zot_process.stderr: - print("Zot stderr:") - for line in io.TextIOWrapper(zot_process.stderr, encoding="utf-8"): - print(line) - else: - print("Not capture any zot stderr") - zot_process.terminate() if os.path.isdir("./output"):