Skip to content

Commit 3b3564e

Browse files
committed
delay pytest
1 parent 4089072 commit 3b3564e

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

pandas/util/_tester.py

+12-14
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@
77
PKG = os.path.dirname(os.path.dirname(__file__))
88

99

10-
try:
11-
import pytest
12-
except ImportError:
13-
def test():
10+
def test(extra_args=None):
11+
try:
12+
import pytest
13+
except ImportError:
1414
raise ImportError("Need pytest>=3.0 to run tests")
15-
else:
16-
def test(extra_args=None):
17-
cmd = ['--skip-slow', '--skip-network']
18-
if extra_args:
19-
if not isinstance(extra_args, list):
20-
extra_args = [extra_args]
21-
cmd = extra_args
22-
cmd += [PKG]
23-
print("running: pytest {}".format(' '.join(cmd)))
24-
sys.exit(pytest.main(cmd))
15+
cmd = ['--skip-slow', '--skip-network']
16+
if extra_args:
17+
if not isinstance(extra_args, list):
18+
extra_args = [extra_args]
19+
cmd = extra_args
20+
cmd += [PKG]
21+
print("running: pytest {}".format(' '.join(cmd)))
22+
sys.exit(pytest.main(cmd))
2523

2624

2725
__all__ = ['test']

0 commit comments

Comments
 (0)