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

Fix exception assertions' content #243

Merged
merged 1 commit into from Aug 27, 2019

Conversation

macisamuele
Copy link
Contributor

The goal of this PR is to fix the failing tests.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.574% when pulling eff92af on macisamuele:maci-fix-tests into c13bcd3 on striglia:master.

@striglia
Copy link
Contributor

striglia commented Aug 26, 2019

Looks good thanks @macisamuele. I'm going to see why I didn't get any emails from Travis about this...

(happy to ship+merge if you like, or we can have Stephan do it too 👍)

Copy link
Contributor

@sjaensch sjaensch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why these tests are passing on appveyor...

@macisamuele macisamuele merged commit 49cd380 into Yelp:master Aug 27, 2019
@macisamuele macisamuele deleted the maci-fix-tests branch August 27, 2019 09:09
@macisamuele
Copy link
Contributor Author

macisamuele commented Aug 27, 2019

@sjaensch For what I see travis executed daily, while appveyor is executed only in case of changes.
Checking the first time pyramid-swagger failed to run tests on master (travis) I see that they started to fail once pytest>=5 was released.

Checking pytest changelog I see

#5412: ExceptionInfo objects (returned by pytest.raises) now have the same str representation as repr, which avoids some confusion when users use print(e) to inspect the object.

This means code like:

with pytest.raises(SomeException) as e:
    ...
assert "some message" in str(e)

Needs to be changed to:

with pytest.raises(SomeException) as e:
    ...
assert "some message" in str(e.value)

which is exactly the content of this PR

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