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
Next Next commit
Add test for the --converters opt
  • Loading branch information
erlend-aasland committed Jul 23, 2023
commit e09e4164a2290a121b5338490668853c3a72d23e
54 changes: 54 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,60 @@ def test_cli_help(self):
out = self.expect_success("-h")
self.assertIn("usage: clinic.py", out)

def test_cli_converters(self):
expected = dedent("""
Legacy converters:
B C D L O S U Y Z Z#
b c d f h i l p s s# s* u u# w* y y# y* z z# z*

Converters:
bool(accept={<class 'object'>})
byte(bitwise=False)
char()
defining_class(type=None)
double()
fildes()
float()
int(accept={<class 'int'>}, type=None)
long()
long_long()
object(converter=None, type=None, subclass_of=None)
Py_buffer(accept={<class '__main__.buffer'>})
Py_complex()
Py_ssize_t(accept={<class 'int'>})
Py_UNICODE(accept={<class 'str'>}, zeroes=False)
PyByteArrayObject()
PyBytesObject()
self(type=None)
short()
size_t()
slice_index(accept={<class 'int'>, <class 'NoneType'>})
str(accept={<class 'str'>}, encoding=None, zeroes=False)
unicode()
unsigned_char(bitwise=False)
unsigned_int(bitwise=False)
unsigned_long(bitwise=False)
unsigned_long_long(bitwise=False)
unsigned_short(bitwise=False)

Return converters:
bool()
double()
float()
init()
int()
long()
Py_ssize_t()
size_t()
unsigned_int()
unsigned_long()

All converters also accept (c_default=None, py_default=None, annotation=None).
All return converters also accept (py_default=None).
""")
out = self.expect_success("--converters")
self.assertEqual(out, expected)


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