UTBot is the tool for automated unit test generation. You can read more about this project on the official website.
This is the support of UTBot for Python.
UTBot tries to maximize the code coverage while minimizing the number of tests. For now, we use only the fuzzing technique for Python.
There are two ways to use UTBot: as an IntelliJ IDEA plugin or through a command line interface.
You can download both archives here.
UTBot Python has been tested on Python 3.8 and 3.9. Some syntax from Python 3.10 is not supported.
Usually nothing has to be done manually, but if you have any troubles with requirements, refer to requirements section in CLI documentation.
IntelliJ IDEA version should be 2022.1.
-
Make sure you already have the Python plugin installed.
-
Download the archive with the plugin and install it following this instruction.
-
Configure the Python interpreter for your project and make sure that IDEA resolves all imports.
-
After indexing has finished, move the cursor to a function, press ALT+SHIFT+U (or ALT+U, ALT+T in Ubuntu), and generate tests.
Package com.intellij.modules.python in /utbot-intellij/resources/plugin.xml is necessary dependecy for now, it is needed to use Python Psi tree.
You can find documentation on CLI usage here.
Read more in UTBot Java Readme.
Read more in UTBot Java Readme.