Closed purhan closed 3 years ago
This is an issue with mock library and is fixed in python 3.8. Should we use python 3.8, or look for a workaround?
We should look for a workaround for now since rest of OpenWISP currently supports Python 3.6 and 3.7.
A possible workaround will be to catch the RuntimeError
in tearDown
:
diff --git a/tests/test_snmp/test_airos.py b/tests/test_snmp/test_airos.py
index 56234d0..fc190e2 100644
--- a/tests/test_snmp/test_airos.py
+++ b/tests/test_snmp/test_airos.py
@@ -168,4 +168,7 @@ class TestSNMPAirOS(unittest.TestCase, MockOutputMixin):
self.assertIsInstance(self.device.uptime_tuple, tuple)
def tearDown(self):
- self.getcmd_patcher.stop()
+ try:
+ self.getcmd_patcher.stop()
+ except RuntimeError:
+ return
Don't forget to add a comment stating why this has been done and to remove it once support for Python 3.8 an above is added.
Note: We have to configure the coveralls bot to comment on PRs.
Closes #50, closes #49, closes #52, closes #55, closes #61