Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctest fails with: inconsistent leading whitespace #3

Open
maet3608 opened this issue Feb 20, 2017 · 1 comment
Open

Doctest fails with: inconsistent leading whitespace #3

maet3608 opened this issue Feb 20, 2017 · 1 comment
Labels

Comments

@maet3608
Copy link
Owner

Under Mac OS some doctests fail with <file.rst> has inconsistent leading whitespace: '\r'
See below:

E ValueError: line 20 of the docstring for rearranging.rst has inconsistent leading whitespace: '\r'
____________________________________________________ ERROR collecting sphinx/source/tutorial/transforming.rst ____________________________________________________
../../anaconda/envs/keras_theano/lib/python2.7/doctest.py:671: in get_doctest
return DocTest(self.get_examples(string, name), globs,
../../anaconda/envs/keras_theano/lib/python2.7/doctest.py:685: in get_examples
return [x for x in self.parse(string, name)
../../anaconda/envs/keras_theano/lib/python2.7/doctest.py:647: in parse
self._parse_example(m, name, lineno)
../../anaconda/envs/keras_theano/lib/python2.7/doctest.py:717: in _parse_example
lineno + len(source_lines))
../../anaconda/envs/keras_theano/lib/python2.7/doctest.py:803: in _check_prefix
(lineno+i+1, name, line))
E ValueError: line 37 of the docstring for transforming.rst has inconsistent leading whitespace: '\r'

@maet3608 maet3608 added the bug label Feb 20, 2017
@maet3608
Copy link
Owner Author

doctests must not be indented, which resolves this issue. For instance,

print 'test'
'test'

will work while

print 'test'
'test'

in some case (which ones?) leads to "inconsistent leading whitespace" errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant