se2p / pynguin

The PYthoN General UnIt Test geNerator is a test-generation tool for Python

Home Page:https://www.pynguin.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate test cases with unittest/syntax equivalent to PyCharm generated test cases syntax

hieucnguyen opened this issue · comments

Hi, thanks a lot for open-sourcing this project! I personally find the "MOSA" algorithm most helpful for my use. If possible, can you add the feature to generate the syntax with unittest syntax (PyCharm class -> Generate... -> Test...) so that it is more industry standard and easier to run?

commented

Hi @hieucnguyen,

thank you for your feedback. Pynguin currently writes its generated test cases in the pytest-style. However, you should be able to change this to the unittest-style, by passing --export-strategy UNIT_TEST to Pynguin. Is this what you meant?

Hi @Wooza,

Thanks for your fast reply. I successfully did it (minor correction for future visitors: --export_strategy UNIT_TEST with an underscore), and also just learned that you can designate a file to be run as Unittest or pytest run in PyCharm: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360002838580-Why-does-PyCharm-not-run-pytest-testing-for-my-application-?page=1#community_comment_360000338139

The issue is resolved for me.