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
I'm seing an issue that I can't explain where doctest output doesn't seem to be captured by Pytest. I develop a library where state changes where I can make an exception happen like this:
But when I run one of my documentation files where an almost identical example appears, it will fail to detect the exception and give a failed test message ending with:
My bad, you can close the issue! Apparently, removing a module from sys.modules isn't the way to block access to (unimported) modules (see e.g. http://stackoverflow.com/q/1350466/288672).
Sorry for bothering you, although thanks for the opportunity to explore the correct way of preventing certain imports!
Hello,
I'm seing an issue that I can't explain where doctest output doesn't seem to be captured by Pytest. I develop a library where state changes where I can make an exception happen like this:
I have created a file that prints a correct checking value when run under regular doctests:
But when I run one of my documentation files where an almost identical example appears, it will fail to detect the exception and give a failed test message ending with:
My environment:
( also replicated the issue on Linux 4.4.0 / Python 2.7.6).
First I suspected that Pytest's output capture could be playing tricks, but the issue is the same even if I invoke with the
-s
commandline flag.I could make a quick replication by doing the following (on the Linux system mentioned above):
(Assuming a fairly empty home directory on a system /w virtualenv installed)
The text was updated successfully, but these errors were encountered: