-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add a testutil class to be able to test formatters easily #32
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
Conversation
Pull Request Test Coverage Report for Build 1780515459
💛 - Coveralls |
|
Permit to do #30 's test with: def test_optional_formatters_argument(
capsys: pytest.CaptureFixture[str],
tmp_path: Path,
) -> None:
"""Test that an optional formatter is correctly turned on and off with arguments."""
with FormatterAssert(
'"""Summary. Body."""', [SplitSummaryAndDocstringFormatter()], capsys, tmp_path
) as asserter:
asserter.assert_format_when_activated()
asserter.assert_no_change_when_deactivated() |
|
Just two general comments:
|
|
@Pierre-Sassoulas Have you had time to look at this? |
|
No sorry I have a pretty busy week, it's on my radar though.
Did you mean a function inside |
No rush!
I think in |
|
Allright I understand.
We could refactor the argparsing to use them (I did not do that yet.) Maybe we could do the refactor first ? what do you think ? |
Yeah makes sense. I'll do a final check of this PR > update the private names > merge and do a follow-up PR to |
|
Follow up in #37. |
|
Thank you for finalizing this for me 😅 |
This will permit to reuse the code to assert that a formatter does something if activated or nothing if deactivated more easily.