From aa40e6097e51d246637975533dd2b227f44e89a1 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 26 Feb 2015 10:45:37 +0100 Subject: [PATCH] Fix tests --- tests/conftest.py | 2 +- tests/handlers/api/test_virtualbox.py | 2 +- tests/handlers/api/test_vpcs.py | 2 +- tests/modules/iou/test_iou_vm.py | 2 +- tests/modules/qemu/test_qemu_manager.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a64d9535..e9448aaf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -97,7 +97,7 @@ def server(request, loop, port_manager, monkeypatch): return Query(loop, host=host, port=port) -@pytest.fixture(scope="module") +@pytest.fixture(scope="function") def project(): """A GNS3 lab""" diff --git a/tests/handlers/api/test_virtualbox.py b/tests/handlers/api/test_virtualbox.py index 16825d1b..ff69aa4f 100644 --- a/tests/handlers/api/test_virtualbox.py +++ b/tests/handlers/api/test_virtualbox.py @@ -19,7 +19,7 @@ import pytest from tests.utils import asyncio_patch -@pytest.yield_fixture(scope="module") +@pytest.yield_fixture(scope="function") def vm(server, project, monkeypatch): vboxmanage_path = "/fake/VboxManage" diff --git a/tests/handlers/api/test_vpcs.py b/tests/handlers/api/test_vpcs.py index e0a4acca..190ab8d0 100644 --- a/tests/handlers/api/test_vpcs.py +++ b/tests/handlers/api/test_vpcs.py @@ -21,7 +21,7 @@ from tests.utils import asyncio_patch from unittest.mock import patch -@pytest.fixture(scope="module") +@pytest.fixture(scope="function") def vm(server, project): response = server.post("/projects/{project_id}/vpcs/vms".format(project_id=project.id), {"name": "PC TEST 1"}) assert response.status == 201 diff --git a/tests/modules/iou/test_iou_vm.py b/tests/modules/iou/test_iou_vm.py index 2333c217..79b2d5c5 100644 --- a/tests/modules/iou/test_iou_vm.py +++ b/tests/modules/iou/test_iou_vm.py @@ -305,4 +305,4 @@ def test_stop_capture(vm, tmpdir, manager, free_console_port, loop): def test_get_legacy_vm_workdir(): - assert IOU.get_legacy_vm_workdir(42) == "iou/device-42" + assert IOU.get_legacy_vm_workdir(42, "bla") == "iou/device-42" diff --git a/tests/modules/qemu/test_qemu_manager.py b/tests/modules/qemu/test_qemu_manager.py index 83092dbe..ee732d11 100644 --- a/tests/modules/qemu/test_qemu_manager.py +++ b/tests/modules/qemu/test_qemu_manager.py @@ -50,4 +50,4 @@ def test_binary_list(loop): def test_get_legacy_vm_workdir(): - assert Qemu.get_legacy_vm_workdir(42) == "qemu/vm-42" + assert Qemu.get_legacy_vm_workdir(42, "bla") == "qemu/vm-42"