From 6c873883ce08165ce75232c4abde81aaa856d57a Mon Sep 17 00:00:00 2001 From: Torgny Bjers Date: Sat, 6 Jun 2026 16:10:51 -0400 Subject: [PATCH 1/2] Apply suggested fix to tests/test_packer.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- tests/test_packer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_packer.py b/tests/test_packer.py index ebb3f1b..afae214 100644 --- a/tests/test_packer.py +++ b/tests/test_packer.py @@ -454,7 +454,7 @@ def test_inline_expression_comment_stripped_no_warning(self, tmp_path, capsys): def test_fallback_warning_when_string_parse_fails(self, tmp_path, capsys, monkeypatch): entry = write(tmp_path, "entry.scad", "// A comment\ncube(10);") - monkeypatch.setattr(sys.modules[Packer.__module__], "getASTfromString", lambda *a, **kw: None) + monkeypatch.setattr("openscad_packer.packer.getASTfromString", lambda *a, **kw: None) result = Packer(str(entry), []).pack() assert "cube" in result captured = capsys.readouterr() @@ -464,7 +464,7 @@ def test_fallback_no_warning_for_empty_file(self, tmp_path, capsys, monkeypatch) # When getASTfromString fails AND the file is empty, the fallback also returns # nothing — `if nodes:` is False so no warning is printed (branch 239->245). entry = write(tmp_path, "entry.scad", "") - monkeypatch.setattr(sys.modules[Packer.__module__], "getASTfromString", lambda *a, **kw: None) + monkeypatch.setattr("openscad_packer.packer.getASTfromString", lambda *a, **kw: None) result = Packer(str(entry), []).pack() assert result.strip() == "" captured = capsys.readouterr() From 9a5faf01c69cd791cd8e6082fa99acb2d7ae6617 Mon Sep 17 00:00:00 2001 From: Torgny Bjers Date: Sat, 6 Jun 2026 16:18:11 -0400 Subject: [PATCH 2/2] Remove unused sys import from tests/test_packer.py Co-Authored-By: Claude Sonnet 4.6 --- tests/test_packer.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_packer.py b/tests/test_packer.py index afae214..ab69583 100644 --- a/tests/test_packer.py +++ b/tests/test_packer.py @@ -1,8 +1,6 @@ """Integration tests for openscad_packer.packer.""" from pathlib import Path -import sys - import pytest from openscad_packer.packer import Packer, PackerError, _strip_expression_comments