-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Report lineno from doctest #2610
Conversation
This is to fix pytest-sugar#122 issue.
not all supported python versions have this availiable |
@RonnyPfannschmidt Even Python 2.6 has, so what doesn't? |
@The-Compiler please excuse my mistake, the python version issues coming from travis upgrading images got me confused, i recalled a different doctest issue not supported on all python versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hongquan !
-
Please add a functional test for this so we can avoid a possible regression in the future.
-
Add a CHANGELOG entry in
changelog
, I suggestchangelog/2610.bugfix
with something like:doctests line numbers are now reported correctly, fixing `pytest-sugar#122 <https://github.com/Frozenball/pytest-sugar/issues/122>`_.
-
Rebase on the latest
master
, I just pushed a fix for the Travis issue.
Hi, I rebased my PR and added changelog entry. However, I have difficulty writing test case. I tried to follow examples in testing/test_doctest.py, but I don't know how to "assert" the output. I wanted to use What should I do? |
I suggest to use |
@hongquan a merge is not a rebase :/ |
Well no biggie. 😁 |
important question - is that lineno the line number in the file, or on a particular doctest element |
Hi. I added test case. I did "merge" instead of "rebase" because rebase will overwrite Git history and make this PR invalid. I will have to close this PR and make a new PR just for the same bug fix. "Merge" and "rebase" are for the same purpose: "bring the latest update to my branch", but "merge" produces less garbage.
According to
The |
After a rebase, you can |
oh, by the way:
Note the "or None if the line number is unavailable" part. This should still be fixed properly in pytest-sugar. |
That is if
The "Commit" tab in this page then will contain a lot of "outdate diff". |
Yes, but if |
I agree with you. |
Thanks @hongquan! |
FYI this breaks our doctesting in astropy and affiliated packages where we use a customized DoctestModule https://circleci.com/gh/astropy/astropy/2583 |
@bsipocz |
Yes, I'm happy that this fixed pytest-sugar, but broke all the others that had used the default None. See my PR for the fix, probably a test will be needed, but I wasn't sure where to add it. |
Thanks. Sorry, I thought that |
This is to fix pytest-sugar#122 issue.