summaryrefslogtreecommitdiffstats
path: root/scripts/automation/regression/unit_tests/functional_tests
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-25 09:54:45 -0500
committerimarom <imarom@cisco.com>2016-02-25 09:57:23 -0500
commitaaef3f95683bfa1574537c543e4ffc86afb0480f (patch)
tree01bf5d21786fb59d13338a75b644eb0fa9a5f20d /scripts/automation/regression/unit_tests/functional_tests
parented7c04b5d7d5bb15aa13144e62caa786e73f7d05 (diff)
port attributes - promiscuous and etc.
Diffstat (limited to 'scripts/automation/regression/unit_tests/functional_tests')
-rw-r--r--scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
index 5ae890ba..f7638746 100644
--- a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
+++ b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
@@ -61,13 +61,13 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test):
def compare_caps (self, cap1, cap2, max_diff_sec = 0.01):
- f1 = open(cap1, 'r')
- reader1 = pcap.Reader(f1)
- pkts1 = reader1.readpkts()
+ with open(cap1, 'r') as f1:
+ reader1 = pcap.Reader(f1)
+ pkts1 = reader1.readpkts()
- f2 = open(cap2, 'r')
- reader2 = pcap.Reader(f2)
- pkts2 = reader2.readpkts()
+ with open(cap2, 'r') as f2:
+ reader2 = pcap.Reader(f2)
+ pkts2 = reader2.readpkts()
assert_equal(len(pkts1), len(pkts2))