From f0a41dcc664bef5da4331fdc7a56fb43506c9b31 Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 5 Aug 2024 08:51:57 -0400 Subject: [PATCH] Rewrite Export test so it doesn't pollute --- test/builtin/files_io/test_importexport.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/builtin/files_io/test_importexport.py b/test/builtin/files_io/test_importexport.py index f51c38dfe..2d2cfd91a 100644 --- a/test/builtin/files_io/test_importexport.py +++ b/test/builtin/files_io/test_importexport.py @@ -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" @@ -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"]