我正在尝试使用 pytest 测试一个 hy 项目,但在 pytest 发现我的测试时遇到了麻烦。需要做什么才能使 pytest 能够获取用 hy 编写的测试?我假设测试可以用 hy 编写并由 pytest 发现,因为native_tests
主 hy repo 中的部分。如果这是一个错误的假设,则无需继续阅读。请告诉我。
我的项目根目录如下所示:
src
.hy program files
tests
__init__.py
test_*.hy test files where each test function is prefixed with test-*
pytest.ini
在 pytest.ini 我有以下内容:
[pytest]
python_functions = test_* is_test_* hyx_test_* hyx_is_test_*
testpaths = tests
我从 hy repo 的 setup.cfg 中偷走了 python_functions 部分
谢谢!