Add packet_capture judgment check on teardown_test
Bug:322894822
Change-Id: I33a707b45c3b475b3e088dce85ba0a3586d4b4d8
diff --git a/acts_tests/tests/google/wifi/WifiIOTConnectionTest.py b/acts_tests/tests/google/wifi/WifiIOTConnectionTest.py
index 382c4de..1a3f194 100644
--- a/acts_tests/tests/google/wifi/WifiIOTConnectionTest.py
+++ b/acts_tests/tests/google/wifi/WifiIOTConnectionTest.py
@@ -65,7 +65,8 @@
def teardown_test(self):
self.dut.droid.wakeLockRelease()
self.dut.droid.goToSleepNow()
- wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
+ if hasattr(self, 'packet_capture'):
+ wutils.stop_pcap(self.packet_capture, self.pcap_procs, False)
def on_fail(self, test_name, begin_time):
self.dut.take_bug_report(test_name, begin_time)