We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importorskip attempts to perform an import and then raises Skipped exception via skip function which has __tracebackhide__ attribute set to True.
__tracebackhide__
This caused the exception in test_importorskip when I added handling of chained exceptions(#1467):
_______________________ test_importorskip _______________________ monkeypatch = <_pytest.monkeypatch.monkeypatch object at 0x110a1e2e8> def test_importorskip(monkeypatch): importorskip = pytest.importorskip def f(): importorskip("asdlkj") try: sys = importorskip("sys") # noqa assert sys == py.std.sys #path = pytest.importorskip("os.path") #assert path == py.std.os.path excinfo = pytest.raises(pytest.skip.Exception, f) > path = py.path.local(excinfo.getrepr().reprcrash.path) testing/test_runner.py:502: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _pytest/_code/code.py:418: in getrepr return fmt.repr_excinfo(self) _pytest/_code/code.py:609: in repr_excinfo reprtraceback = self.repr_traceback(excinfo) _pytest/_code/code.py:585: in repr_traceback last = traceback[-1] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = [], key = -1 def __getitem__(self, key): > val = super(Traceback, self).__getitem__(key) E IndexError: list index out of range _pytest/_code/code.py:289: IndexError
The exception is raised because the traceback entry in the original exception is filtered (because of __tracebackhide__ local variable set to True).
True
The text was updated successfully, but these errors were encountered:
Comment a workaround for pytest-dev#1485.
89df701
Thanks! Closing as duplicate of #905.
Sorry, something went wrong.
No branches or pull requests
importorskip attempts to perform an import and then raises Skipped exception via skip function which has
__tracebackhide__
attribute set to True.This caused the exception in test_importorskip when I added handling of chained exceptions(#1467):
The exception is raised because the traceback entry in the original exception is filtered (because of
__tracebackhide__
local variable set toTrue
).The text was updated successfully, but these errors were encountered: