You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently merged #15768 makes it possible to run doctests under pytest using the pytest-doctestplus plugin from astropy. Sympy's existing (internal) doctest runner runs doctests differently from the stdlib doctest module, the pytest default doctest plugin, and the doctestplus plugin.
Specifically the difference is that Sympy's doctest runner requires all names to be explicitly imported. The other doctest runners (following the stdlib) all provide implicit imports from the defining module so e.g. you can do
# mod.pydeffunc():
''' >>> func() 1 '''return1
and the test will pass. Sympy's test runner would treat the other as an error and require instead:
# mod.pydeffunc():
''' >>> from mod import func >>> func() 1 '''return1
The text was updated successfully, but these errors were encountered:
oscarbenjamin
added
the
Testing
Related to the test runner. Do not use for test failures unless it relates to the test runner itself
label
Jan 23, 2019
@drdavella @asmeurer
Recently merged #15768 makes it possible to run doctests under pytest using the pytest-doctestplus plugin from astropy. Sympy's existing (internal) doctest runner runs doctests differently from the stdlib doctest module, the pytest default doctest plugin, and the doctestplus plugin.
Specifically the difference is that Sympy's doctest runner requires all names to be explicitly imported. The other doctest runners (following the stdlib) all provide implicit imports from the defining module so e.g. you can do
and the test will pass. Sympy's test runner would treat the other as an error and require instead:
It is not currently possible to have this behaviour with doctestplus but I don't think it would be hard to add support for it. I think it just amounts to setting
globs
to an empty dict here:https://github.com/astropy/pytest-doctestplus/blob/master/pytest_doctestplus/plugin.py#L376
There would need to be some setting in doctestplus to control this though.
The text was updated successfully, but these errors were encountered: