test, contrib, refactor: use with when opening a file
This commit is contained in:
1 parent
269dcad16e
commit
027aab663a
7 files changed
+54
-47
No files matched your search
@@ -58,7 +58,8 @@ class VersionBitsWarningTest(BitcoinTestFramework):
|
||||
|
||||
def versionbits_in_alert_file(self):
|
||||
"""Test that the versionbits warning has been written to the alert file."""
|
||||
alert_text = open(self.alert_filename, 'r', encoding='utf8').read()
|
||||
with open(self.alert_filename, 'r', encoding='utf8') as f:
|
||||
alert_text = f.read()
|
||||
return VB_PATTERN.search(alert_text) is not None
|
||||
|
||||
def run_test(self):
|
||||
|
||||
Reference in new issue
Block a user