Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode

This commit is contained in:
grossmj committed 2022-08-24 21:03:16 +02:00
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 tests.utils import asyncio_patch
from gns3server.utils.asyncio import wait_run_in_executor
@@ -23,8 +24,7 @@ from gns3server.utils.asyncio import wait_run_in_executor
from gns3server.controller.gns3vm.virtualbox_gns3_vm import VirtualBoxGNS3VM
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def gns3vm(controller):
vm = VirtualBoxGNS3VM(controller)
@@ -16,12 +16,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest
import pytest_asyncio
from gns3server.controller.gns3vm.vmware_gns3_vm import VMwareGNS3VM
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def gns3vm(controller):
vm = VMwareGNS3VM(controller)
+3 -4
View File
@@ -19,6 +19,7 @@
import os
import json
import pytest
import pytest_asyncio
import zipfile
from pathlib import Path
@@ -32,8 +33,7 @@ from gns3server.utils.asyncio import aiozipstream
from gns3server.controller.controller_error import ControllerError
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def project(controller):
p = Project(controller=controller, name="test")
@@ -41,8 +41,7 @@ async def project(controller):
return p
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def node(controller, project):
compute = MagicMock()
+2 -2
View File
@@ -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
from gns3server.controller.link import Link
@@ -26,8 +27,7 @@ from gns3server.controller.controller_error import ControllerError
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def link(project, compute):
node1 = Node(project, compute, "node1", node_type="qemu")
+1
View File
@@ -30,6 +30,7 @@ def compute():
s.id = "http://test.com:42"
return s
@pytest.fixture
def node(compute, project):
node = Node(project, compute, "demo",
+2 -2
View File
@@ -16,13 +16,13 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest
import pytest_asyncio
from unittest.mock import MagicMock
from tests.utils import AsyncioMagicMock
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def node(project):
compute = MagicMock()
+2 -3
View File
@@ -17,9 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import uuid
import pytest
import pytest_asyncio
from unittest.mock import MagicMock
from tests.utils import AsyncioMagicMock, asyncio_patch
from unittest.mock import patch
@@ -32,8 +32,7 @@ from gns3server.controller.controller_error import ControllerError, ControllerNo
from gns3server.config import Config
@pytest.fixture
@pytest.mark.asyncio
@pytest_asyncio.fixture
async def node(controller, project):
compute = MagicMock()