mirror of https://github.com/progval/irctest.git
use consistent import style in filelock shim (#241)
This commit is contained in:
parent
4f1a84b5a8
commit
1548287335
|
@ -4,16 +4,15 @@ commonly packaged by Linux distributions but might not be available
|
|||
in some environments.
|
||||
"""
|
||||
|
||||
import contextlib
|
||||
import os
|
||||
from typing import ContextManager
|
||||
from typing import Any, ContextManager
|
||||
|
||||
if os.getenv("PYTEST_XDIST_WORKER"):
|
||||
# running under pytest-xdist; filelock is required for reliability
|
||||
from filelock import FileLock
|
||||
else:
|
||||
# normal test execution, no port races
|
||||
import contextlib
|
||||
from typing import Any
|
||||
|
||||
def FileLock(*args: Any, **kwargs: Any) -> ContextManager[None]:
|
||||
return contextlib.nullcontext()
|
||||
|
|
Loading…
Reference in New Issue