Open Kodiologist opened 1 day ago
Given that inspect.getsourcelines()
from the Python stdlib fails, that seems like something that's unrelated to pytest and should be fixed by Hy - looks like an issue is open already:
We do already catch various exceptions there:
If it's as easy as catching tokenize.TokenError
there too, I suppose we could do that - but I wouldn't want to go much further than that if Hy breaks more Python stdlib stuff.
I'm not sure how much of the inspect
module can ever be made to work with Hy. pytest has historically worked quite well with small changes, and pytest guarding against another exception type that inspect.getsourcelines
can raise makes sense to me.
In this example, pytest hits an internal error when trying to report "fixture 'f' not found". I don't know how to reproduce it without Hy; I suspect the problem is that
_pytest.fixtures.formatrepr
callsinspect.getsourcelines
without any provisions for the possibility that there isn't real Python code in the source file. I notice that the internal error doesn't occur if you replace the[
at the beginning of the program withx
.