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

Allow for curbing logs while testing #1241

Open
nikochiko opened this issue Aug 1, 2020 · 0 comments
Open

Allow for curbing logs while testing #1241

nikochiko opened this issue Aug 1, 2020 · 0 comments

Comments

@nikochiko
Copy link

nikochiko commented Aug 1, 2020

Is your feature request related to a problem? Please describe.
Yes, I am writing tests for my graphene app. I need to test whether certain queries produce errors. When client.execute(...)is run, this logs an annoying graphql.error.located_error.GraphQLLocatedError. I cannot even use pytest.raises or self.assertRaises in unittest because it only logs without actually raising an error. It even logs the entire traceback which is even more annoying.

Describe the solution you'd like
It'd be much better if we had a solution to have a loglevel flag in client.execute(...) or some other way to disable logging of those specific errors.

Describe alternatives you've considered
I have considered disabling all error logs from the test runner (with logging.disable(logging.ERROR)). I am going with this for now but I don't want to miss out on other important logs which may help in surfacing faulty tests.

Additional context
Add any other context or screenshots about the feature request here.

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