Use pytest-asyncio auto mode

This commit is contained in:
grossmj committed 2022-08-27 21:10:17 +02:00
1 parent 600c18f04b
commit fc7d5be736
28 files changed
+36 -60

No files matched your search

@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest_asyncio
import pytest
from tests.utils import asyncio_patch, AsyncioMagicMock
from gns3server.utils.asyncio import wait_run_in_executor
@@ -24,7 +24,7 @@ from unittest.mock import patch
from gns3server.controller.gns3vm.virtualbox_gns3_vm import VirtualBoxGNS3VM
@pytest_asyncio.fixture
@pytest.fixture
async def gns3vm(controller):
vm = VirtualBoxGNS3VM(controller)
@@ -16,12 +16,11 @@
# 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_asyncio.fixture
@pytest.fixture
async def gns3vm(controller):
vm = VMwareGNS3VM(controller)
+2 -3
View File
@@ -19,7 +19,6 @@
import os
import json
import pytest
import pytest_asyncio
import aiohttp
import zipfile
@@ -33,7 +32,7 @@ from gns3server.controller.export_project import export_project, _is_exportable
from gns3server.utils.asyncio import aiozipstream
@pytest_asyncio.fixture
@pytest.fixture
async def project(controller):
p = Project(controller=controller, name="test")
@@ -41,7 +40,7 @@ async def project(controller):
return p
@pytest_asyncio.fixture
@pytest.fixture
async def node(controller, project):
compute = MagicMock()
+1 -2
View File
@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest
import pytest_asyncio
import aiohttp
from unittest.mock import MagicMock
@@ -27,7 +26,7 @@ from gns3server.controller.ports.serial_port import SerialPort
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
@pytest_asyncio.fixture
@pytest.fixture
async def link(project, compute):
node1 = Node(project, compute, "node1", node_type="qemu")
+2 -2
View File
@@ -15,13 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import pytest_asyncio
import pytest
from unittest.mock import MagicMock
from tests.utils import AsyncioMagicMock
@pytest_asyncio.fixture
@pytest.fixture
async def node(project):
compute = MagicMock()
+1 -2
View File
@@ -20,7 +20,6 @@ import os
import sys
import uuid
import pytest
import pytest_asyncio
import aiohttp
from unittest.mock import MagicMock
from tests.utils import AsyncioMagicMock, asyncio_patch
@@ -34,7 +33,7 @@ from gns3server.controller.ports.ethernet_port import EthernetPort
from gns3server.config import Config
@pytest_asyncio.fixture
@pytest.fixture
async def node(controller, project):
compute = MagicMock()