Python 3.6 introduced a file system path protocol (PEP 519). The standard library APIs accepting file system paths now accept path objects too. It could be useful to add this here as well for convenience.
Also please remember to submit patches with -U9999, so that Phab has full context.
|42 ↗||(On Diff #172641)|
Please use conditional skipping instead. Maybe write a @skip_if_no_fspath decorator in util.py and use it for all tests. Skipping will have the advantage that instead of silently pretending we have less tests, we'd explicitly tell user why some of the tests aren't run.
|6 ↗||(On Diff #172641)|
Wouldn't it be better to use if HAS_FSPATH here? In normal circumstances, the pathlib import will be unnecessarily attempted (and it will succeed if pathlib package is installed), even though it will never be used inside tests.
That's fair, changed string to just x, should be obvious from the context what x is.
Thank you for the review. As I don't have commit access I'd like to ask you to commit this on my behalf.