Basic Python and Java testing and running issues #19345
|
Hello everybody! I'm brand new to Pants and have mostly managed to get it going thanks to the documentation, except for a couple of things. Please see this basic repo (initial commit 2e6c976) with Python and Java code. Three issues:
Any advice would be greatly appreciated! |
Replies: 3 comments
|
Pants is working as intended. Your issue is that your python tests contain no test functions. Pytest expects test functions to start with |
|
Or there is probably pytest config to change the test discovery pattern, but again that is a pytest thing, not a Pants thing. |
|
For completeness, the immediate solutions were:
But I've made a few other changes, which required adding an explicit dependency |
For completeness, the immediate solutions were:
test_in order for Pytest to recognise them.entry_pointofpex_binaryin the Python app BUILD file to refer to the function.:lineprinterto thedeploy_jarin the Java app BUILD file.But I've made a few other changes, which required adding an explicit dependency
:line_printertopex_binarytoo (commit b79f589). Now you can run the apps (which now take arguments) withpants run src/python/app/line_printer:lp -- 2 3 4andpants run src/java/app/lineprinter:lp -- 2 3 4.