Feature request #935915: Add os.path.devnull.
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 @@
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 @@
EnvironTests,
WalkTests,
MakedirTests,
+ DevNullTests,
)
if __name__ == "__main__":