Skip to content

Commit 2c8023d

Browse files
committed
Make transfer_markers a noop when importing fails
1 parent e868913 commit 2c8023d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pytest_asyncio/plugin.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
import socket
77

88
import pytest
9-
from _pytest.python import transfer_markers
9+
try:
10+
from _pytest.python import transfer_markers
11+
except ImportError: # Pytest 4.1.0 removes the transfer_marker api (#104)
12+
def transfer_markers(*args, **kwargs): # noqa
13+
"""Noop when over pytest 4.1.0"""
14+
pass
1015

1116
try:
1217
from async_generator import isasyncgenfunction

0 commit comments

Comments
 (0)