Skip to content

Basic Python and Java testing and running issues #19345

Closed Answered by SweetTalkingBaby
SweetTalkingBaby asked this question in Q&A
Discussion options

You must be logged in to vote

For completeness, the immediate solutions were:

  1. The Python test functions need to begin with test_ in order for Pytest to recognise them.
  2. Changed the entry_point of pex_binary in the Python app BUILD file to refer to the function.
  3. Added an explicit dependency :lineprinter to the deploy_jar in the Java app BUILD file.

But I've made a few other changes, which required adding an explicit dependency :line_printer to pex_binary too (commit b79f589). Now you can run the apps (which now take arguments) with pants run src/python/app/line_printer:lp -- 2 3 4 and pants run src/java/app/lineprinter:lp -- 2 3 4.

Replies: 3 comments

Comment options

benjyw
Jun 19, 2023
Maintainer Sponsor

You must be logged in to vote
0 replies
Comment options

benjyw
Jun 19, 2023
Maintainer Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by SweetTalkingBaby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants