Skip to content

Commit

Permalink
Properly close files used for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
timfel committed Jul 21, 2024
1 parent c93d2e7 commit 23e8f52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/test_before_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def test(tmp_path):
project_with_before_build_asserts.generate(project_dir)

before_build = (
"""python -c "import sys; open('{project}/pythonversion_bb.txt', 'w').write(sys.version)" && """
f'''python -c "import sys; open('{{project}}/pythonprefix_bb.txt', 'w').write({SYS_PREFIX})"'''
"""python -c "import sys; f = open('{project}/pythonversion_bb.txt', 'w'); f.write(sys.version); f.close()" && """
f'''python -c "import sys; f = open('{{project}}/pythonprefix_bb.txt', 'w'); f.write({SYS_PREFIX}); f.close()"'''
)

# build the wheels
Expand Down
4 changes: 2 additions & 2 deletions test/test_before_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test(tmp_path, build_frontend_env):
test_projects.new_c_project().generate(test_project_dir)

before_test_steps = [
'''python -c "import os, sys; open('{project}/pythonversion_bt.txt', 'w').write(sys.version)"''',
'''python -c "import os, sys; open('{project}/pythonprefix_bt.txt', 'w').write(sys.prefix)"''',
'''python -c "import os, sys; f = open('{project}/pythonversion_bt.txt', 'w'); f.write(sys.version); f.close()"''',
'''python -c "import os, sys; f = open('{project}/pythonprefix_bt.txt', 'w'); f.write(sys.prefix); f.close()"''',
]

if utils.platform == "pyodide":
Expand Down

0 comments on commit 23e8f52

Please sign in to comment.