-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Implement WriteLogger #403
Conversation
Please don’t do this unittest thing of subclassing. I don’t see anything speaking against a fixture that yields first one type and than the other? You should be even able to pass instances if I see it correctly on my phone. |
I hate the unittest style but it was already being used. I got the subclassing approach from the stdlib :p How bout I just refactor this into bare functions and parametrize the class with pytest? |
Yes that’s where I learned to hate it. ;)
💗💗💗 i mean leave the class to group them, otherwise the function names get a bit long? |
Alright, done! |
You can simplify this by using a fixture: @pytest.fixture(name="logger_cls", params=(WriteLogger, PrintLogger))
def _logger_cls(request):
return request.param |
Alright, done. |
tests/test_loggers.py
Outdated
class TestPrintLogger: | ||
def test_prints_to_stdout_by_default(self, capsys): | ||
class TestLoggers: | ||
"""Tests common to the Print and WriteLoggers.""" |
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.
"""Tests common to the Print and WriteLoggers.""" | |
""" | |
Tests common to the Print and WriteLoggers. | |
""" |
There's a bunch of unused imports – pls fix that and we're done here. |
Yessir |
thankssss |
<3 |
The WriteLogger.
Let me know if this is good and I can add some docs.