[New-bugs-announce] [issue16045] create some unit tests for built-in int()

Chris Jerdonek report at bugs.python.org
Tue Sep 25 15:28:42 CEST 2012

New submission from Chris Jerdonek:

The built-in function int() does not seem to have any basic unit tests (e.g. in test_builtin).  It would be good to add some.

Some cases (including edge cases) for possible inclusion:

int(base='foo')  # no exception; returns 0
int(x=5, base=10)  # raises TypeError
int(5.8)  # test truncation towards zero
int(-5.8)  # ditto
int('5.8')  # raises ValueError

Both positional and keyword argument combinations should be tested.

components: Library (Lib)
keywords: easy
messages: 171270
nosy: chris.jerdonek, ezio.melotti
priority: normal
severity: normal
status: open
title: create some unit tests for built-in int()
type: enhancement
versions: Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list