mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Feature request #935915: Add os.path.devnull.
This commit is contained in:
parent
f30d60edbc
commit
bdec50f027
8 changed files with 31 additions and 6 deletions
|
@ -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__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue