-
Notifications
You must be signed in to change notification settings - Fork 43
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
add string matching to assert_log_level
#1327
Conversation
83a1be0
to
a2f0f50
Compare
I think what would also be good to have is a context manager that avoids us doing
and just use this everywhere instead of the current |
I think that could be nice, yea. I can work on that and add a commit to this branch. |
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.
@momchil-flex I added the context manager, I do think this improves the workflow a lot
with AssertLogLevel(log_capture, "WARNING"):
# do stuff
also updated all tests to use it
That's nice! Only thing I'm wondering about is that the context manager affects the passed |
yea I agree, this is probably better. I added a commit that only clears a This made a couple tests fail in # anisotropic medium, warn allow_gain is ignored
_ = td.AnisotropicMedium(xx=td.Medium(), yy=mL, zz=mS, allow_gain=True)
assert_log_level(log_capture, "WARNING")
_ = td.AnisotropicMedium(xx=td.Medium(), yy=mL, zz=mS, allow_gain=False)
assert_log_level(log_capture, "WARNING") I think this is the validator in question. perhaps were just capturing the warnings from the previous lines. I'm not sure if there's a bug in |
1053863
to
7085d41
Compare
note @momchil-flex I just force pushed to resolve conflicts with develop. |
7b17a31
to
edd01b8
Compare
Ok actually this uncovered a bug in my own implementation. I adjusted the logic and it should work now. Basically how it works is that the context manager never clears the log_capture, but it only looks at the records introduced in the context (between |
Great. Seems like |
edd01b8
to
cb44c45
Compare
…hing contains_str, AssertLogLevel context
cb44c45
to
1bdb83a
Compare
No description provided.