Skip to content
New issue

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

Investigate failing py3 build with multiple test failures #796

Closed
shashank88 opened this issue Jul 5, 2019 · 5 comments
Closed

Investigate failing py3 build with multiple test failures #796

shashank88 opened this issue Jul 5, 2019 · 5 comments
Assignees

Comments

@shashank88
Copy link
Contributor

shashank88 commented Jul 5, 2019

E AssertionError: assert 'Library test' in '<ExceptionInfo LibraryNotFoundException tblen=3>' E + where '<ExceptionInfo LibraryNotFoundException tblen=3>' = str(<ExceptionInfo LibraryNotFoundException tblen=3>)
Multiple tests are failing with the above.

@shashank88
Copy link
Contributor Author

I think the issue is that pytest.raises now returns: https://docs.pytest.org/en/latest/reference.html#exceptioninfo
and str(e) no longer returns just the stringified error code. Possible that we might have to use . getrepr to get the same thing? Possibly breaking due to a new pytest version for py3?

@shashank88
Copy link
Contributor Author

shashank88 commented Jul 5, 2019

pytest-dev/pytest#5412 breaks the tests as str(e) no longer returns the message.
pytest 5.0.1 changes pytest.raises behaviour and it's a py3 only release.

@shashank88
Copy link
Contributor Author

shashank88 commented Jul 5, 2019

In [5]: def a():
...: raise BlahException("testing 12 333")

In [10]: with pytest.raises(Exception) as e:
...: a()
...:
...: print(str(e))
...: print(type(e))
...:

<class '_pytest._code.code.ExceptionInfo'>

@shashank88
Copy link
Contributor Author

Need to change the the code to use str(e.value) instead of str(e) for py3. Need to check if the same works with py2.

@shashank88
Copy link
Contributor Author

Fixed with PR: #797

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant