diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-06-08 08:29:33 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-06-08 08:29:33 (GMT) |
commit | bdec50f0277971830e307aff8090c1494a69f4ce (patch) | |
tree | 19ae2f89e1b093efd1062a997d9139c781b9d9a9 /Lib/test/test_os.py | |
parent | f30d60edbc0d5047a2fdd01e25868e4b814107e2 (diff) | |
download | cpython-bdec50f0277971830e307aff8090c1494a69f4ce.zip cpython-bdec50f0277971830e307aff8090c1494a69f4ce.tar.gz cpython-bdec50f0277971830e307aff8090c1494a69f4ce.tar.bz2 |
Feature request #935915: Add os.path.devnull.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 4cdc29d..b05bffc 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -334,6 +334,14 @@ class MakedirTests (unittest.TestCase): 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(): test_support.run_unittest( @@ -342,6 +350,7 @@ def test_main(): EnvironTests, WalkTests, MakedirTests, + DevNullTests, ) if __name__ == "__main__": |