Update format for parsing files

This commit is contained in:
Michael Mintz 2020-04-25 23:45:00 -04:00
parent 358a25ddf7
commit 415aacb57a
1 changed files with 2 additions and 3 deletions

View File

@ -1274,9 +1274,8 @@ def main(shell_command):
"Expecting: %s\n"
% (seleniumbase_file, expected_arg))
f = open(seleniumbase_file, 'r')
with open(seleniumbase_file, 'r', encoding='utf-8') as f:
all_code = f.read()
f.close()
if "def test_" not in all_code:
raise Exception("\n\n`%s` is not a valid SeleniumBase unittest file!\n"
"\nExpecting: %s\n"