Skip to content

Commit

Permalink
test_autowrap: Change to a temporary directory before testing writes …
Browse files Browse the repository at this point in the history
…to relative paths

Fixes sympy#24075
  • Loading branch information
chatcannon committed Sep 24, 2022
1 parent 870bd54 commit 2355222
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sympy/utilities/tests/test_autowrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,16 @@ def test_autowrap_store_files():
def test_autowrap_store_files_issue_gh12939():
x, y = symbols('x y')
tmp = './tmp'
saved_cwd = os.getcwd()
temp_cwd = tempfile.mkdtemp()
try:
os.chdir(temp_cwd)
f = autowrap(x + y, backend='dummy', tempdir=tmp)
assert f() == str(x + y)
assert os.access(tmp, os.F_OK)
finally:
shutil.rmtree(tmp)
os.chdir(saved_cwd)
shutil.rmtree(temp_cwd)


def test_binary_function():
Expand Down

0 comments on commit 2355222

Please sign in to comment.