MCPcopy
hub / github.com/Textualize/rich / test_inspect_integer_with_methods_python311

Function test_inspect_integer_with_methods_python311

tests/test_inspect.py:312–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

310@skip_py313
311@skip_py314
312def test_inspect_integer_with_methods_python311():
313 # to_bytes and from_bytes methods on int had minor signature change -
314 # they now, as of 3.11, have default values for all of their parameters
315 expected = (
316 "╭──────────────── <class 'int'> ─────────────────╮\n"
317 "│ int([x]) -> integer │\n"
318 "│ int(x, base=10) -> integer │\n"
319 "│ │\n"
320 "│ denominator = 1 │\n"
321 "│ imag = 0 │\n"
322 "│ numerator = 1 │\n"
323 "│ real = 1 │\n"
324 "│ as_integer_ratio = def as_integer_ratio(): │\n"
325 "│ Return integer ratio. │\n"
326 "│ bit_count = def bit_count(): Number of │\n"
327 "│ ones in the binary │\n"
328 "│ representation of the │\n"
329 "│ absolute value of self. │\n"
330 "│ bit_length = def bit_length(): Number of │\n"
331 "│ bits necessary to represent │\n"
332 "│ self in binary. │\n"
333 "│ conjugate = def conjugate(...) Returns │\n"
334 "│ self, the complex conjugate │\n"
335 "│ of any int. │\n"
336 "│ from_bytes = def from_bytes(bytes, │\n"
337 "│ byteorder='big', *, │\n"
338 "│ signed=False): Return the │\n"
339 "│ integer represented by the │\n"
340 "│ given array of bytes. │\n"
341 "│ to_bytes = def to_bytes(length=1, │\n"
342 "│ byteorder='big', *, │\n"
343 "│ signed=False): Return an │\n"
344 "│ array of bytes representing │\n"
345 "│ an integer. │\n"
346 "╰────────────────────────────────────────────────╯\n"
347 )
348 assert render(1, methods=True) == expected
349
350
351@skip_pypy3

Callers

nothing calls this directly

Calls 1

renderFunction · 0.70

Tested by

no test coverage detected