Skip to content

Commit

Permalink
test the pyprojectexception case
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkerrigan committed Dec 13, 2024
1 parent fe519a4 commit f6aeeeb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/poetry_plugin_freeze/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def handle(self) -> int:
iced = IcedPoet(project_root, self.option("wheel-dir"), self.option("exclude"))
iced.check()
fridge[iced.name] = iced
except PyProjectException:
pass
except PyProjectException as err:
self.line_error(f"skipping {project_root}: {err}")

for iced in fridge.values():
iced.set_fridge(fridge)
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/non_poetry_package/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[project]
name = "non-poetry-package"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []
7 changes: 6 additions & 1 deletion tests/test_freeze.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import csv
import re
import zipfile
from email.parser import Parser
from io import StringIO
Expand All @@ -15,12 +16,14 @@ def test_project_roots(fixture_root):
fixture_root / "nested_packages",
fixture_root / "nested_packages" / "others" / "app_c",
fixture_root / "nested_packages" / "others" / "app_with_extras",
fixture_root / "non_poetry_package",
]


def test_excluded_config_path_project_roots(fixture_root):
assert sorted(project_roots(fixture_root, fixture_root / "nested_packages" / "others")) == [
fixture_root / "nested_packages"
fixture_root / "nested_packages",
fixture_root / "non_poetry_package",
]


Expand Down Expand Up @@ -62,6 +65,8 @@ def mock_freeze(self):
assert poet_options["wheel_dir"] == "dist"
assert poet_options["exclude_packages"] == []

assert re.match("skipping.*non_poetry_package", cmd.io.fetch_error())


def test_freeze_nested(fixture_root, fixture_copy):
package = fixture_copy(fixture_root / "nested_packages")
Expand Down

0 comments on commit f6aeeeb

Please sign in to comment.