Skip to content

Conversation

@nicoddemus
Copy link
Member

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.

Replaces #7425.

Copy link
Member

@bluetech bluetech left a 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.

@nicoddemus
Copy link
Member Author

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. 👍

@nicoddemus nicoddemus self-assigned this Oct 7, 2020
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.
@nicoddemus nicoddemus force-pushed the new-pytester-fixture branch from 6963d00 to a8b07ce Compare October 10, 2020 13:30
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a 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

"""
import warnings
from _pytest.warning_types import PYTESTER_COPY_EXAMPLE
Copy link
Member

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

Copy link
Member

@bluetech bluetech left a 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

@nicoddemus
Copy link
Member Author

Anything else @bluetech @RonnyPfannschmidt ?

@nicoddemus nicoddemus merged commit 69419cb into pytest-dev:master Oct 12, 2020
@nicoddemus nicoddemus deleted the new-pytester-fixture branch October 12, 2020 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants