From 3608c0c1588dabe78d0f72507a953a274d2bf70e Mon Sep 17 00:00:00 2001 From: "Leandro G. Almeida" Date: Mon, 1 Jun 2026 09:19:38 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20tests:=20strengthen=20C++=20binding?= =?UTF-8?q?=20smoke=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../template/tests/test_python_bindings.py.jinja | 11 ++++++++++- tests/test_template/test_cpp_template.py | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/repoman/cpp_template/template/tests/test_python_bindings.py.jinja b/src/repoman/cpp_template/template/tests/test_python_bindings.py.jinja index ec69e46..d91e67b 100644 --- a/src/repoman/cpp_template/template/tests/test_python_bindings.py.jinja +++ b/src/repoman/cpp_template/template/tests/test_python_bindings.py.jinja @@ -7,9 +7,18 @@ import importlib def main() -> None: module = importlib.import_module("{{ cpp_namespace }}") + assert module.add(2, 3) == 5 - assert module.__version__ == "0.1.0" assert module.version() == "0.1.0" + assert module.__version__ == "0.1.0" + assert module.__doc__ + + try: + module.add("2", 3) + except TypeError: + pass + else: + raise AssertionError("add() should reject non-integer arguments") if __name__ == "__main__": diff --git a/tests/test_template/test_cpp_template.py b/tests/test_template/test_cpp_template.py index 5736d77..545da1d 100644 --- a/tests/test_template/test_cpp_template.py +++ b/tests/test_template/test_cpp_template.py @@ -67,7 +67,11 @@ def test_cpp_template_renders_spinach_style_structure(tmp_path: Path) -> None: assert "option('build_python_bindings'" in meson_options assert '"pybind11>=2.13.6"' in pyproject assert 'module.attr("__version__") = sample_cpp::version();' in python_bindings + assert 'module.add(2, 3) == 5' in python_bindings_test + assert 'module.version() == "0.1.0"' in python_bindings_test assert 'module.__version__ == "0.1.0"' in python_bindings_test + assert "assert module.__doc__" in python_bindings_test + assert "except TypeError:" in python_bindings_test assert "PYTHONPATH=build uv run python" in readme assert "make check-docs" in github_ci assert "make check" in github_ci