[Python-checkins] python/dist/src/Lib/test test_os.py,1.23,1.24

loewis at users.sourceforge.net loewis at users.sourceforge.net
Tue Jun 8 04:29:35 EDT 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32478/Lib/test

Modified Files:
	test_os.py 
Log Message:
Feature request #935915: Add os.path.devnull.


Index: test_os.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** test_os.py	2 Jun 2004 18:42:25 -0000	1.23
--- test_os.py	8 Jun 2004 08:29:32 -0000	1.24
***************
*** 335,338 ****
--- 335,346 ----
          os.removedirs(path)
  
+ class DevNullTests (unittest.TestCase):
+     def test_devnull(self):
+         f = file(os.devnull, 'w')
+         f.write('hello')
+         f.close()
+         f = file(os.devnull, 'r')
+         assert f.read() == ''
+         f.close()
  
  def test_main():
***************
*** 343,346 ****
--- 351,355 ----
          WalkTests,
          MakedirTests,
+         DevNullTests,
      )
  




More information about the Python-checkins mailing list