From ed5408476c55f8b7ec551e1ae1e089a10060f86e Mon Sep 17 00:00:00 2001 From: marsninja Date: Sat, 27 Jul 2024 07:31:46 -0400 Subject: [PATCH 1/2] tweak --- jaclang/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jaclang/settings.py b/jaclang/settings.py index 31a7b2f05..4ab07755e 100644 --- a/jaclang/settings.py +++ b/jaclang/settings.py @@ -1,4 +1,4 @@ -"""Main settings of Jac lang.""" +"""Main settings of jac lang.""" import configparser import os From 704ceb7039da361607d56bb3d9ff6a2afc83b1e7 Mon Sep 17 00:00:00 2001 From: marsninja Date: Sun, 28 Jul 2024 10:47:25 -0400 Subject: [PATCH 2/2] test: mac friendly --- jaclang/compiler/tests/test_importer.py | 9 --------- jaclang/tests/fixtures/package_import.jac | 6 ------ jaclang/tests/test_language.py | 6 +++--- 3 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 jaclang/tests/fixtures/package_import.jac diff --git a/jaclang/compiler/tests/test_importer.py b/jaclang/compiler/tests/test_importer.py index a3f51fb50..6352d0ea8 100644 --- a/jaclang/compiler/tests/test_importer.py +++ b/jaclang/compiler/tests/test_importer.py @@ -54,12 +54,3 @@ def test_jac_py_import_auto(self) -> None: "{SomeObj(a=10): 'check'} [MyObj(apple=5, banana=7), MyObj(apple=5, banana=7)]", stdout_value, ) - - def test_package_import(self) -> None: - """Test package import.""" - captured_output = io.StringIO() - sys.stdout = captured_output - cli.run(self.fixture_abs_path("../../../tests/fixtures/package_import.jac")) - sys.stdout = sys.__stdout__ - stdout_value = captured_output.getvalue() - self.assertEqual("package is imported successfully!\n", stdout_value) diff --git a/jaclang/tests/fixtures/package_import.jac b/jaclang/tests/fixtures/package_import.jac deleted file mode 100644 index 41c2f8594..000000000 --- a/jaclang/tests/fixtures/package_import.jac +++ /dev/null @@ -1,6 +0,0 @@ -import:py tkinter as tk ; -import:py from tkinter, messagebox ; - -with entry { - print("package is imported successfully!") ; -} \ No newline at end of file diff --git a/jaclang/tests/test_language.py b/jaclang/tests/test_language.py index f83a0aa5d..6f180ddf4 100644 --- a/jaclang/tests/test_language.py +++ b/jaclang/tests/test_language.py @@ -712,12 +712,12 @@ def test_random_check(self) -> None: import jaclang.compiler.absyntree as ast import ast as py_ast - module_paths = ["random", "tkinter"] + module_paths = ["random", "ast"] for module_path in module_paths: stdlib_dir = sysconfig.get_paths()["stdlib"] file_path = os.path.join( stdlib_dir, - module_path + (".py" if module_path == "random" else "/__init__.py"), + module_path + ".py", ) with open(file_path) as f: jac_ast = PyastBuildPass( @@ -730,7 +730,7 @@ def test_random_check(self) -> None: if module_path == "random": self.assertIn("ModulePath - statistics -", gen_ast) else: - self.assertIn("+-- Name - TclError - Type: No", gen_ast) + self.assertIn("+-- Name - NodeTransformer - Type: No", gen_ast) settings.py_raise = False def test_deep_py_load_imports(self) -> None: # we can get rid of this, isn't?