Skip to content

Commit d35db93

Browse files
committed
fix doctests
1 parent 6c7436e commit d35db93

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

nipype/interfaces/utility/base.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# -*- coding: utf-8 -*-
22
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
4-
"""Various utilities
4+
"""
5+
Various utilities
56
67
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
10-
>>> os.chdir(datadir)
8+
9+
.. testsetup::
10+
import os
11+
filepath = os.path.dirname( os.path.realpath( __file__ ) )
12+
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
13+
os.chdir(datadir)
14+
15+
1116
"""
1217
from __future__ import print_function, division, unicode_literals, absolute_import
1318
from builtins import range

nipype/interfaces/utility/csv.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"""CSV Handling utilities
55
66
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
10-
>>> os.chdir(datadir)
7+
8+
.. testsetup::
9+
import os
10+
filepath = os.path.dirname( os.path.realpath( __file__ ) )
11+
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
12+
os.chdir(datadir)
13+
14+
1115
"""
1216
from __future__ import print_function, division, unicode_literals, absolute_import
1317
from builtins import zip, range, str, open

nipype/interfaces/utility/wrappers.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"""Various utilities
55
66
Change directory to provide relative paths for doctests
7-
>>> import os
8-
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
9-
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
10-
>>> os.chdir(datadir)
7+
8+
.. testsetup::
9+
import os
10+
filepath = os.path.dirname( os.path.realpath( __file__ ) )
11+
datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
12+
os.chdir(datadir)
13+
14+
1115
"""
1216
from __future__ import print_function, division, unicode_literals, absolute_import
1317

0 commit comments

Comments
 (0)