mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode
This commit is contained in:
1 parent
2e91eac1eb
commit
86c44cd6e7
39 files changed
+100
-101
No files matched your search
@@ -16,6 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
||||
@@ -23,8 +24,7 @@ from gns3server.compute.docker import Docker, DOCKER_PREFERRED_API_VERSION, DOCK
|
||||
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.mark.asyncio
|
||||
@pytest_asyncio.fixture
|
||||
async def vm():
|
||||
|
||||
vm = Docker()
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
import uuid
|
||||
import sys
|
||||
import os
|
||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
||||
|
||||
@@ -33,8 +33,7 @@ from gns3server.utils.get_resource import get_resource
|
||||
from unittest.mock import patch, MagicMock, call
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@pytest.mark.asyncio
|
||||
@pytest_asyncio.fixture
|
||||
async def manager(port_manager):
|
||||
|
||||
m = Docker.instance()
|
||||
@@ -42,8 +41,7 @@ async def manager(port_manager):
|
||||
return m
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@pytest.mark.asyncio
|
||||
@pytest_asyncio.fixture(scope="function")
|
||||
async def vm(compute_project, manager):
|
||||
|
||||
vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", aux_type="none")
|
||||
|
||||
Reference in new issue
Block a user