Close package.json after using it
Showing
1 changed file
with
2 additions
and
1 deletions
... | @@ -47,7 +47,8 @@ SYS_ARGS = sys.argv[1:] | ... | @@ -47,7 +47,8 @@ SYS_ARGS = sys.argv[1:] |
47 | 47 | ||
48 | if len(SYS_ARGS) and SYS_ARGS[0] == '__selfcommandtest': | 48 | if len(SYS_ARGS) and SYS_ARGS[0] == '__selfcommandtest': |
49 | print('Starting Python executable tests...') | 49 | print('Starting Python executable tests...') |
50 | pkg_version = json.loads(open('package.json').read()).get('version') | 50 | with open('package.json') as f: |
51 | pkg_version = json.load(f).get('version') | ||
51 | scripts_path = os.path.join(CASPER_PATH, 'tests', 'commands') | 52 | scripts_path = os.path.join(CASPER_PATH, 'tests', 'commands') |
52 | assert(test_cmd('--help').find(pkg_version) > -1) | 53 | assert(test_cmd('--help').find(pkg_version) > -1) |
53 | assert(test_cmd('--version').strip() == pkg_version) | 54 | assert(test_cmd('--version').strip() == pkg_version) | ... | ... |
-
Please register or sign in to post a comment