mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Refactor asyncio locking system for Python 3.7 support. Ref https://github.com/GNS3/gns3-gui/issues/2566 Ref https://github.com/GNS3/gns3-gui/issues/2568
This commit is contained in:
1 parent
ad9b6f42bf
commit
902de3dd47
12 files changed
+57
-42
No files matched your search
@@ -21,7 +21,7 @@ import pytest
|
||||
import sys
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from gns3server.utils.asyncio import wait_run_in_executor, subprocess_check_output, wait_for_process_termination, locked_coroutine
|
||||
from gns3server.utils.asyncio import wait_run_in_executor, subprocess_check_output, wait_for_process_termination, locking
|
||||
from tests.utils import AsyncioMagicMock
|
||||
|
||||
|
||||
@@ -84,7 +84,8 @@ def test_lock_decorator(loop):
|
||||
def __init__(self):
|
||||
self._test_val = 0
|
||||
|
||||
@locked_coroutine
|
||||
@locking
|
||||
@asyncio.coroutine
|
||||
def method_to_lock(self):
|
||||
res = self._test_val
|
||||
yield from asyncio.sleep(0.1)
|
||||
|
||||
Reference in new issue
Block a user