[Python-Dev] unittest assertRaisesRegex bug? (original) (raw)

Ethan Furman ethan at stoneleaf.us
Wed Mar 19 23:17:53 CET 2014


On 03/19/2014 03:13 PM, Antoine Pitrou wrote:

On Wed, 19 Mar 2014 14:37:42 -0700 Ethan Furman <ethan at stoneleaf.us> wrote:

Here's the code in question:

class PsuedoFloat: def init(self, value): self.value = float(value) def int(self): return int(self.value) pi = PsuedoFloat(3.1415) self.assertRaisesRegex(TypeError, '%x format: an integer is required, not PsuedoFloat', '%x'.mod, pi), Here's the exception: ====================================================================== ERROR: testformatting (test.testunicode.UnicodeTest) ---------------------------------------------------------------------- TypeError: 'PsuedoFloat' object is not callable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/ethan/source/python/issue19995/Lib/test/testunicode.py", line 1156, in testformatting self.assertRaisesRegex(TypeError, '%c'.mod, pi), This is certainly not the code you are showing above.

More words, please! :)

Do you mean you agree it's a bug, or do you mean you think I misstepped in reporting what's going on?

-- Ethan



More information about the Python-Dev mailing list