[Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: test_datetime.py test_os.py

Kristján Valur Jónsson kristjan at ccpgames.com
Thu Jan 15 10:13:13 CET 2009


Ok, in r 68610 I fixed some of this.
The strftime test is now just an excercise, since clearly some platforms accept the %e without hesitation.
Also, there were errors in two test_os cases.

However, these:

======================================================================
ERROR: test_ftruncate (test.test_os.TestInvalidFD)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py", line 570, in test_ftruncate
    self.assertRaises(OSError, os.ftruncate, 10, 0)
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 345, in failUnlessRaises
    callableObj(*args, **kwargs)
IOError: [Errno 9] Bad file descriptor

======================================================================
FAIL: test_close (test.test_os.TestInvalidFD)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_os.py", line 542, in helper
    self.assertRaises(OSError, getattr(os, f), 10)
AssertionError: OSError not raised

Seem bogus.
For ftruncate, an invalid filedescriptor really should return OSError, and close(10) should raise an OSError as well.

However, these are just being mapped up from whatever the OS returns, so I suppose I should make the tests more lenient?
K

-----Original Message-----
From: python-dev-bounces+kristjan=ccpgames.com at python.org [mailto:python-dev-bounces+kristjan=ccpgames.com at python.org] On Behalf Of Jean-Paul Calderone
Sent: 14. janúar 2009 20:20
To: python-dev at python.org
Subject: Re: [Python-Dev] [Python-checkins] r68547 - in python/trunk/Lib/test: test_datetime.py test_os.py

On Mon, 12 Jan 2009 19:09:28 +0100 (CET), "kristjan.jonsson" <python-checkins at python.org> wrote:
>Author: kristjan.jonsson
>Date: Mon Jan 12 19:09:27 2009
>New Revision: 68547
>
>Log:
>Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module.
>
>Modified:
>   python/trunk/Lib/test/test_datetime.py
>   python/trunk/Lib/test/test_os.py

Several of the tests added to test_os.py are invalid and fail.

Jean-Paul
_______________________________________________
Python-Dev mailing list
Python-Dev at python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/kristjan%40ccpgames.com



More information about the Python-Dev mailing list