-
Notifications
You must be signed in to change notification settings - Fork 76
feat(tests): use logger instead of printing #920
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
base: main
Are you sure you want to change the base?
Conversation
@@ -580,8 +580,7 @@ def test_poisson_fem(ctx_factory): | |||
J[c] * w[k] * sum(ell, dpsi(i,k,ell) * dpsi(j,k,ell)) | |||
""", | |||
assumptions="nels>=1 and nbf >= 1 and nels mod 4 = 0") | |||
|
|||
print(knl) | |||
logger.info("%s", knl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is kind of a weird pattern to me. Does logger.info(knl)
not work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never actually tried that, but yeah, seems to work! :)) That would have been much easier to search and replace..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'm in love with these changes. print
seems just fine to me; pytest suppresses stdout anyway. Could you explain the motivation a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't say I feel very strongly about this, so feel free to drop it. 😕
I mostly tried to use logging things because (1) they can write to stderr (by default, right?) or files and (2) add time stamps and things like that. But yeah, not sure those are super useful in tests..
Thanks for responding! I think I might just leave this here for now. Maybe it'll turn out later that we want it. 🙂 |
cc @alexfikl