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
New pytester fixture #7854
New pytester fixture #7854
Conversation
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.
Great, LGTM with some comments.
Thanks for the great review @bluetech (I should actually caught many of the problems myself before opening this). I will get back to this once I have some free time, next weekend at latest. 👍 |
New pytester fixture with same functionality as testdir, but dealing with pathlib.Path objects. Also: * Change Testdir to be a thin wrapper which only delegates to PyTester. * Convert test_doctest to use test_path and tmp_path. * Removed some str() calls now unnecessary given py35 support has been dropped. * Use test_path in test_no_brokenpipeerror_message: it uses a private method which I don't think we should expose in Testdir for now.
6963d00
to
a8b07ce
Compare
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.
I absolutely love the overall pr, i wonder if we should provide a plugin with a reverse shim for older pytest / python versions to unblock people porting to the new api even if they are on old python/pytest
It might be a nice hacktober item for someone
src/_pytest/pytester.py
Outdated
"""Copy file from project's directory into the testdir. | ||
|
||
:param str name: The name of the file to copy. | ||
:returns: Path to the copied directory (inside ``self.tmpdir``). | ||
:return: path to the copied directory (inside ``self.path``). | ||
|
||
""" | ||
import warnings | ||
from _pytest.warning_types import PYTESTER_COPY_EXAMPLE |
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.
I think it can go
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.
Left a few minor comments, in addition to a couple previous suggestions
Anything else @bluetech @RonnyPfannschmidt ? |
New pytester fixture with same functionality as testdir, but dealing
with pathlib.Path objects.
Also:
which I don't think we should expose in Testdir for now.
Replaces #7425.