Skip to content

gh-106368: Increase Argument Clinic CLI test coverage #107156

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

Merged
merged 11 commits into from
Jul 24, 2023
Prev Previous commit
Improve accuracy of test_cli_converters
  • Loading branch information
erlend-aasland committed Jul 24, 2023
commit a4adb705d7d8e23d413a8f12f7066df558d10ca0
18 changes: 13 additions & 5 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,14 +1518,22 @@ def test_cli_converters(self):
out = self.expect_success("--converters")
# We cannot simply compare the output, because the repr of the *accept*
# param may change (it's a set, thus unordered). So, let's compare the
# start and end of the expected output, and then assert we've got a
# line for each converter.
# start and end of the expected output, and then assert that the
# converters appear lined up in alphabetical order.
self.assertTrue(out.startswith(prelude), out)
for converter in expected_converters:
with self.subTest(converter=converter):
self.assertIn(converter, out)
self.assertTrue(out.endswith(finale), out)

out = out.removeprefix(prelude)
out = out.removesuffix(finale)
lines = out.split("\n")
for converter, line in zip(expected_converters, lines):
line = line.lstrip()
with self.subTest(converter=converter):
self.assertTrue(
line.startswith(converter),
f"expected converter {converter!r}, got {line!r}"
)


try:
import _testclinic as ac_tester
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy