git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
systematic use of context managers for dealing with files instead of open()/close...
[nepi.git]
/
test
/
resources
/
linux
/
ns3
/
cross_dce_linux_ccn.py
diff --git
a/test/resources/linux/ns3/cross_dce_linux_ccn.py
b/test/resources/linux/ns3/cross_dce_linux_ccn.py
index
7dbee17
..
109d44d
100755
(executable)
--- a/
test/resources/linux/ns3/cross_dce_linux_ccn.py
+++ b/
test/resources/linux/ns3/cross_dce_linux_ccn.py
@@
-243,9
+243,8
@@
class LinuxNS3FdNetDeviceTest(unittest.TestCase):
time.sleep(60)
stdout = ec.trace(ccncat, "stdout")
- f = open("bunny.ts", "w")
- f.write(stdout)
- f.close()
+ with open("bunny.ts", "w") as f:
+ f.write(stdout)
#expected = "DATA"
#self.assertTrue(stdout.find(expected) > -1)