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

[MRG + 1] Add suppress_warnings flag #155

Merged
merged 3 commits into from
Oct 19, 2018

Conversation

jonathanlloyd
Copy link
Contributor

resolves #139

I've used the built in warning suppression here - let me know what you think.

Happy Hacktoberfest!

@codecov-io
Copy link

codecov-io commented Oct 17, 2018

Codecov Report

Merging #155 into master will increase coverage by 0.42%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
+ Coverage   84.47%   84.89%   +0.42%     
==========================================
  Files          12       12              
  Lines        1198     1205       +7     
  Branches      288      289       +1     
==========================================
+ Hits         1012     1023      +11     
+ Misses        142      139       -3     
+ Partials       44       43       -1
Impacted Files Coverage Δ
camelot/cli.py 93.68% <100%> (+0.2%) ⬆️
camelot/io.py 100% <100%> (ø) ⬆️
camelot/parsers/lattice.py 91.47% <0%> (+0.56%) ⬆️
camelot/parsers/stream.py 92.52% <0%> (+1.72%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5645ef5...f7683d5. Read the comment docs.

@vinayak-mehta
Copy link
Contributor

@jonathanlloyd Happy Hacktoberfest to you too!

This looks good to me. Can you add the suppress_warnings option to the CLI too?

@jonathanlloyd
Copy link
Contributor Author

Added a --quiet flag to the CLI 🙂

except Exception as e:
assert type(e).__name__ == 'UserWarning'
assert str(e) == 'No tables found on page-1'
assert str(e.value) == 'No tables found on page-1'
Copy link
Contributor

Choose a reason for hiding this comment

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

@jonathanlloyd Should this be one indent level down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its a bit weird but that's actually how it's documented: https://docs.pytest.org/en/latest/assert.html
It seems to work 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh. I looked at the tests for requests and they seem to do it this way too. https://github.com/requests/requests/blob/master/tests/test_requests.py#L817 If you ever find why pytest implemented it this way, do comment here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very odd!

@vinayak-mehta
Copy link
Contributor

LGTM! Can you just address the one comment on the indent level? @jonathanlloyd

@vinayak-mehta vinayak-mehta changed the title [MRG] Add suppress_warnings flag [MRG + 1] Add suppress_warnings flag Oct 19, 2018
@vinayak-mehta vinayak-mehta merged commit 3def4a5 into atlanhq:master Oct 19, 2018
@vinayak-mehta
Copy link
Contributor

@jonathanlloyd Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

Allow logger setting
3 participants