Skip to main content

Pynguin

Pynguin (IPA: ˈpɪŋɡuiːn), the PYthoN General UnIt test geNerator, is a tool that allows developers to generate unit tests automatically.

Testing software is often considered to be a tedious task. Thus, automated generation techniques have been proposed and mature tools exist—for statically typed languages, such as Java. There is, however, no fully automated tool available that produces unit tests for general-purpose programs in a dynamically typed language. Pynguin is, to the best of our knowledge, the first tool that fills this gap and allows the automated generation of unit tests for Python programs.

Internal Pipeline Status

pipeline status coverage report

License MIT Ruff PyPI version Supported Python Versions Documentation Status DOI REUSE status Downloads SWH

Pynguin Logo

Attention

Please Note:

Pynguin executes the module under test! As a consequence, depending on what code is in that module, running Pynguin can cause serious harm to your computer, for example, wipe your entire hard disk! We recommend running Pynguin in an isolated environment; use, for example, a Docker container to minimize the risk of damaging your system.

Pynguin is only a research prototype! It is not tailored towards production use whatsoever. However, we would love to see Pynguin in a production-ready stage at some point; please report your experiences in using Pynguin to us.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed Python 3.10 (the support for 3.11, 3.12, 3.13, and 3.14 is experimental).

    Attention: Pynguin now requires at least Python 3.10! Older versions are no longer supported!

  • You have a recent Linux/macOS/Windows machine.

Please consider reading the online documentation to start your Pynguin adventure.

Installing Pynguin

Pynguin can be easily installed using the pip tool by typing:

pip install pynguin

Make sure that your version of pip is that of a supported Python version, as any older version is not supported by Pynguin!

Using Pynguin

Before you continue, please read the quick start guide

Pynguin is a command-line application. Once you installed it to a virtual environment, you can invoke the tool by typing pynguin inside this virtual environment. Pynguin will then print a list of its command-line parameters.

A minimal full command line to invoke Pynguin could be the following, where we assume that a project foo is located in /tmp/foo, we want to store Pynguin's generated tests in /tmp/testgen, and we want to generate tests using a whole-suite approach for the module foo.bar (wrapped for better readability):

pynguin \
  --project-path /tmp/foo \
  --output-path /tmp/testgen \
  --module-name foo.bar

Please find a more detailed example in the quick start guide.

Contributing to Pynguin

For the development of Pynguin you will need the poetry dependency management and packaging tool. To start developing, follow these steps:

  1. Clone the repository

  2. Change to the pynguin folder: cd pynguin

  3. Create a virtual environment and install dependencies using poetry: poetry install

  4. Make your changes

  5. Run make check to verify that your changes pass all checks

    Please see the poetry documentation for more information on this tool.

Contributors

Pynguin is developed at the Chair of Software Engineering II of the University of Passau.

Maintainer: Lukas Krodinger

Former Maintainer: Stephan Lukasczyk

Contributors:

Development using PyCharm.

If you want to use the PyCharm IDE, you have to set up a few things:

  1. Import pynguin into PyCharm.
  2. Let PyCharm configure a virtual environment using poetry.
  3. Set the default test runner to pytest
  4. Set the DocString format to Google

License

This project is licensed under the terms of the MIT License. Pynguin was using the GNU Lesser General Public License (LGPL) until version 0.29.0, its license was changed with version 0.30.0.

Star History

Star History Chart

Release files for pynguin 0.47.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pynguin 0.47.0
File Size Uploaded
pynguin-0.47.0.tar.gz 848.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pynguin 0.47.0
File Interpreter ABI Platform
pynguin-0.47.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / pynguin-0.47.0.tar.gz

Download URL pynguin-0.47.0.tar.gz
Size 848.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e85958085d4e5072e12edced74b28d6e06c13d1c4218864ae53f55add26ebd48
BLAKE2b-256 checksum
How to use checksums
3f34717eaac7f1f362e25d8529f8d0c2aff3234d92290cbe13de0ce7404df2b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / pynguin-0.47.0-py3-none-any.whl

Download URL pynguin-0.47.0-py3-none-any.whl
Size 694.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94d0c82f7271ced37f1132ef83e60d7a72365915cfe2922cdf9ecb46b1e3e5dc
BLAKE2b-256 checksum
How to use checksums
f3b6afa0b68d25f90e3e46058063011602816f2bee7792e19d220fe2c2e923bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.47.0 This release

2 release files

0.46.0

2 release files

0.45.0

2 release files

0.44.0

2 release files

0.42.0

2 release files

0.41.0

2 release files

0.38.0

2 release files

0.37.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.32.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.2

2 release files

0.25.1

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.21.0

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.16.1

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.13.2

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

1 release file

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page