-
Notifications
You must be signed in to change notification settings - Fork 40
MNT: Compat with pytest 5.4.0 #95
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
Conversation
failure is related, I can come back in the evening, but not earlier. |
This comment has been minimized.
This comment has been minimized.
Update: I don't have enough pytest-fu to fix the error. Looking at the code, the thing that seems most intuitive is to have I wonder if @RonnyPfannschmidt or @nicoddemus has any insights for us. Relevant CI log: https://travis-ci.org/github/astropy/pytest-doctestplus/jobs/662066066
|
Hi folks, I will wait for @RonnyPfannschmidt to chime in as he is more familiar with the |
i took a initial look, inheriting from both a item and a collector like module was broken to begin with, as far as i can tell doctestplus changes a assumption in tying to run a complete file as test, combining test items and file collectors works purely by accident, the new code added a to the point constructor for the test item which broke the file collector bits that came in as well |
Thanks, @RonnyPfannschmidt . But, oh dear, sounds like a complete refactoring is needed to make this compatible and I am not sure if I am up for the task. |
@@ -272,7 +280,7 @@ def parse(self, s, name=None): | |||
if ext not in comment_characters: | |||
warnings.warn("file format '{}' is not recognized, assuming " | |||
"'{}' as the comment character." | |||
.format(ext, comment_characters['rst'])) | |||
.format(ext, comment_characters['.rst'])) |
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.
This is already fixed in #101 and should be gone after rebase.
if PYTEST_LT_5_4: | ||
yield DoctestItem(test.name, self, runner, test) | ||
else: | ||
yield DoctestItem.from_parent( |
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.
This does not work because I think now Python's doctest
tries to read in the docstring as it is defined in the test file, not via testdir
fixture. I stared at the code here, the code in pytest
, and Python doc, but couldn't figure out a path forward.
Simply renaming the old runtest
to collect
doesn't work either:
Wait a minute, my local test is totally different from Travis CI results. I cannot even get the tests to collect. My brain hurts.
|
Fix #94
Due to pytest-dev/pytest#5975