Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/test_packer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -454,7 +452,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()
Expand All @@ -464,7 +462,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()
Expand Down
Loading