You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 calls inspect.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 with x.
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:
error_msg="file %s, line %s: source code not available"
addline(error_msg% (fspath, lineno+1))
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.
I'd be happy to accept a PR, but don't really consider this a Pytest bug - if we happen to support Hy that's lovely, but it's not something we advertise or promise to anyone.
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
.The text was updated successfully, but these errors were encountered: