Comment 13 for bug 1178807

Revision history for this message
John Vandenberg (jayvdb) wrote :

I think all doctest runners supports custom globals. The following fails:

`
_m = 1

def doctest_stuff(self):
    '''
        >>> _m
        1
    '''
    return 1

if __name__ == "__main__":
    import doctest
    doctest.testmod(globs={})
`

The problem is that pyflakes and other tools are assuming doctests are run with the default `doctest.testmod` arguments.

I've raised a bug for the list of desired globals to be more easily specified in a way other tools can detect.

http://bugs.python.org/issue25699