pytest-dev / py

Python development support library (note: maintenance only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] ensurepath causes index errors if the path is empty

jmrgibson opened this issue · comments

I'm trying to embed pytest in an application binary (eg pyoxidize) indygreg/PyOxidizer#69

In this case, I explicitly don't want to load any python modules from the file system (aside from when pytest collects tests) so sys.path is empty, which means this line https://github.com/pytest-dev/py/blob/master/py/_path/local.py#L643 causes an index error. Easily resolved by changing the line to if not sys.path or sys.path[0] != s

Would you like me to make a PR to change this?

modern pytest should no longer be using that,
for this lib - maintenance only, its here to die