Skip to content

Commit 9495b52

Browse files
committed
TEST: Use pytest.ini in nipype.test, allow disabling parallel
1 parent 9497d35 commit 9495b52

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

nipype/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525

2626

2727
class NipypeTester(object):
28-
def __call__(self, doctests=True):
28+
def __call__(self, doctests=True, parallel=True):
2929
try:
3030
import pytest
3131
except:
3232
raise RuntimeError(
3333
'py.test not installed, run: pip install pytest')
34-
params = {'args': []}
35-
if doctests:
36-
params['args'].append('--doctest-modules')
37-
nipype_path = os.path.dirname(__file__)
38-
params['args'].extend(
39-
['-x', '--ignore={}/external'.format(nipype_path), nipype_path])
40-
pytest.main(**params)
34+
args = []
35+
if not doctests:
36+
args.extend(['-p', 'no:doctest'])
37+
if not parallel:
38+
args.append('-n0')
39+
args.append(os.path.dirname(__file__))
40+
pytest.main(args=args)
4141

4242

4343
test = NipypeTester()

0 commit comments

Comments
 (0)