Skip to content

Commit

Permalink
Rewrite Export test so it doesn't pollute
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Aug 5, 2024
1 parent d4e108b commit f0a41dc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/builtin/files_io/test_importexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest

from mathics.builtin.atomic.strings import to_python_encoding
from mathics.core.systemsymbols import SymbolFailed

# def test_import():
# eaccent = "\xe9"
Expand Down Expand Up @@ -260,6 +261,16 @@ def test_private_doctests_importexport(str_expr, msgs, str_expected, fail_msg):
)


def test_inividually():
with tempfile.NamedTemporaryFile(mode="w", suffix=".jcp") as tmp:
filename = osp.join(tmp.name, "123.jcp")
expr = f'Export["{filename}", 1+x,' + "{}]"
result = evaluate(expr)
outs = [out.text for out in session.evaluation.out]
assert result == SymbolFailed
assert outs == [f"Cannot infer format of file {filename}."]


# TODO:
# mmatera: please put in pytest conditionally
# >> System`Convert`B64Dump`B64Encode["∫ f  x"]
Expand Down

0 comments on commit f0a41dc

Please sign in to comment.