All Projects → cleder → awesome-python-testing

cleder / awesome-python-testing

Licence: CC0-1.0 License
Collection of awesome Python resources for testing, PRs are welcome ;-)

Projects that are alternatives of or similar to awesome-python-testing

core
The core of Japa. It includes all the primitives to build a test runner
Stars: ✭ 350 (+560.38%)
Mutual labels:  test-runners
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+37222.64%)
Mutual labels:  test-runners
tropic
🍍 Test Runner Library
Stars: ✭ 29 (-45.28%)
Mutual labels:  test-runners

Awesome Python Testing Awesome

Collection of awesome Python resources for testing and generating test data.

Contents

Testing Frameworks

  • pytest - A mature full-featured Python testing tool.
  • awesome-pytest - A curated list of awesome pytest resources.
  • hammett - Fast python test runner, compatible with a subset of pytest.
  • unittest - (Python standard library) Unit testing framework.
  • doctest - (Python standard library) The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown.
  • xdoctest - A rewrite of Python's builtin doctest module (with pytest plugin integration) with AST instead of REGEX.
  • nose2 - The successor to nose, based on unittest2.
  • Robot Framework - A generic test automation framework.
  • awesome-robotframework - A curated list of awesome Robot Framework resources and libraries.
  • testbook - A unit testing framework extension for testing code in Jupyter Notebooks.
  • ward - Ward is a modern test framework for Python with a focus on productivity and readability.
  • async-asgi-testclient - A framework-agnostic library for testing ASGI web applications.

Test Runners

  • green - A clean, colorful test runner.
  • tox - Auto builds and tests distributions in multiple Python versions.
  • nox - Nox is a command-line tool that automates testing in multiple Python environments, similar to tox. Unlike tox, Nox uses a standard Python file for configuration.

Property Based Testing

  • hypothesis - Hypothesis is an advanced Quickcheck style property based testing library.
  • Atheris - Atheris is a coverage-guided Python fuzzing engine. It supports fuzzing of Python code, but also native extensions written for CPython.

Mutation Testing

  • mutmut - Mutmut is a mutation testing system for Python, with a strong focus on ease of use.
  • Cosmic Ray - Cosmic Ray is a mutation testing tool for Python 3. It makes small changes to your source code, running your test suite for each one.

Behavior-driven Development

  • mamba - The definitive testing tool for Python. Born under the banner of BDD.
  • behave - BDD, Python style.
  • lettuce - Behavior-driven-development tool for python, inspired by Cucumber for Ruby.

UI Testing

  • PyAutoGUI - PyAutoGUI is a cross-platform GUI automation Python module for human beings.
  • Selenium - Python bindings for Selenium WebDriver.
  • SeleniumBase - SeleniumBase is an all-in-one Python framework for automated browser testing. Tests are run with "pytest", and use WebDriver APIs for web-page interaction.
  • sixpack - A language-agnostic A/B Testing framework.
  • splinter - Open source tool for testing web applications.
  • helium - Selenium-python is great for web automation. Helium makes it easier to use.
  • LuluTest - LuluTest is an open source browser automation framework using Python and Selenium. It is relatively lightweight in that it mostly provides wrappers for 3rd party library methods that make browser automation and testing more intuitive.
  • Golem - Golem is a test framework and a complete tool for browser automation. Tests can be written with code in Python, codeless using the web IDE, or both.
  • selene - User-oriented Web UI browser tests in Python (Selenide port).
  • pytest-ui-automatic - Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report.
  • flybirds - Flybirds is a front-end UI automation test framework based on BDD mode, providing a series of out-of-the-box tools and complete documentation.

Rest API Testing

  • Schemathesis - A tool for automatic property-based testing of web applications built with Open API / Swagger specifications.
  • hypothesis-graphql - Hypothesis strategies for GraphQL schemas, queries and data.
  • tavern - Tavern is a pytest plugin, command-line tool and Python library for automated testing of APIs, with a simple, concise and flexible YAML-based syntax.
  • SnapshotTest - Snapshot testing is a way to test your APIs without writing actual test cases.
  • playback - A Python decorator-based framework that lets you "record" and "replay" operations (e.g. API requests, workers consuming jobs from queues).
  • behave-restful - BDD Framework to Test REST Services and APIs.
  • RESTler - RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.
  • HttpRunner - HttpRunner is a simple & elegant, yet powerful HTTP(S) testing framework.
  • dredd - Dredd is a language-agnostic command-line tool for validating API description document against backend implementation of the API.

Load Testing

  • locust - Scalable user load testing tool written in Python.
  • dynamic-workload-model - Code to generate dynamic workload model. Useful for testing autoscaling in cloud or mimicking different load profile for different scenario.
  • pynonymizer - Pynonymizer is a universal tool for translating sensitive production database dumps into anonymized copies. This can help you support GDPR/Data Protection in your organization without compromizing on quality testing data.

Penetration Testing

  • fsociety - A Modular Penetration Testing Framework.

Mock

  • doublex - Powerful test doubles framework for Python.
  • freezegun - Travel through time by mocking the datetime module.
  • time-machine - Travel through time in your tests.
  • httmock - A mocking library for requests for Python 2.6+ and 3.2+.
  • httpretty - HTTP request mock tool for Python.
  • mock - (Python standard library) A mocking and patching library.
  • mocket - A socket mock framework with gevent/asyncio/SSL support.
  • responses - A utility library for mocking out the requests Python library.
  • VCR.py - Record and replay HTTP interactions on your tests.
  • moto - A library that allows you to easily mock out tests based on AWS infrastructure.
  • Mockintosh - Mockintosh aims to provide usual HTTP mock service functionality with small resource footprint, making it friendly for microservice applications. You can have tens of mocks at once, inside moderate laptop or single Docker container.
  • flexmock - Flexmock is a testing library for Python that makes it easy to create mocks, stubs and fakes.
  • cornell - Cornell: record & replay mock server.
  • aioresponses - Aioresponses is a helper for mock/fake web requests in python aiohttp package.
  • Kesha - A web service with a user interface for testing http requests and web hooks. Allows you to create an http mock for http requests.

Assertions

  • Precisely - Precisely allows you to write precise assertions so you only test the behaviour you're really interested in. This makes it clearer to the reader what the expected behaviour is, and makes tests less brittle.
  • sure - An idiomatic assertion toolkit with human-friendly failure messages, inspired by RSpec Expectations and should.js.
  • PyHamcrest - PyHamcrest is a framework for writing matcher objects, allowing you to declaratively define "match" rules. There are a number of situations where matchers are invaluable, such as UI validation, or data filtering, but it is in the area of writing flexible tests that matchers are most commonly used.
  • dirty-equals - A python library that (mis)uses the __eq__ method to make python code (generally unit tests) more declarative and therefore easier to read and write.
  • pytest_cache_assert - Cache assertion data to simplify regression testing of complex serializable data

Object Factories

  • factory_boy - A test fixtures replacement for Python.
  • mixer - Another fixtures replacement. Supports Django, Flask, SQLAlchemy, Peewee and etc.
  • model_bakery - Model Bakery offers you a smart way to create fixtures for testing in Django. With a simple and powerful API you can create many objects with a single line of code.
  • pydantic-factories - This library offers mock data generation for pydantic based models. This means any user defined models as well as third party libraries that use pydantic as a foundation, e.g. SQLModel, FastAPI, Beanie, Ormar and others.

Fake Data

  • fake2db - Fake database generator.
  • faker - A Python package that generates fake data.
  • mimesis - A Python library that helps you generate fake data.
  • radar - Generate random datetime / time.
  • genuine-fake - Genuine Fake means an imitation of a (usually) valuable object that is so good that it is, to all intents and purposes, identical.
  • autofaker - A Python library designed to minimize the setup/arrange phase of your unit tests by removing the need to manually write code to create anonymous variables as part of a test cases setup/arrange phase.

Design by Contract

  • icontract - Design-by-contract in Python3 with informative violation messages and inheritance.
  • deal - Design by contract for Python with static checker and test generation.

Code Coverage

Static Checks

  • pyflakes - A simple program which checks Python source files for errors.
  • pylint - Pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
  • pyanalyze - A tool for programmatically detecting common mistakes in Python code, such as references to undefined variables and some categories of type mismatches.
  • bandit - Bandit is a tool designed to find common security issues in Python code.
  • flake8 - flake8 is a python tool that glues together pep8, pyflakes, mccabe, and third-party plugins to check the style and quality of python code.
  • awesome-flake8-extensions - A curated list of awesome flake8 extensions.
  • Typecheckers - A list of Python type checkers.
  • awesome-python-typing - Collection of awesome Python types, stubs, plugins, and tools to work with them.
  • slotscheck - Find mistakes in your __slots__ definitions.

Articles

Tools

  • Pynguin - Pynguin, the PYthoN General UnIt test geNerator, is a tool that allows developers to generate unit tests automatically.
  • Ponicode - AI-powered unit testing interface for VS Code. Write, generate, modify and visualise all kinds of unit tests for JavaScript, TypeScript and Python.
  • Auger - Auger is a project to automatically generate unit tests for Python code.
  • ApprovalTests - Approvals work by comparing the test results to a golden master.
  • pytest-codegen - Pytest-codgen will statically analyze your code to create pytest function stubs.
  • teyit - A static analyzer and a refactoring tool to rewrite your unittest assertions in the right way.
  • pytestify - Automatically convert unittests to pytest.
  • pifpaf - Pifpaf is a suite of fixtures and a command-line tool that allows to start and stop daemons for a quick throw-away usage. This is typically useful when needing these daemons to run integration testing.
  • mock_autogen - A tool to auto generate the basic mocks and asserts for faster unit testing using the AAA pattern.
  • pytest-mock-generator - A pytest fixture wrapper for mock_autogen.
  • ghostwriter - Writing tests with Hypothesis frees you from the tedium of deciding on and writing out specific inputs to test. Now, the hypothesis.extra.ghostwriter module can write your test functions for you too!
  • Klara - Klara is a static analysis tools to automatic generate test case, based on SMT (z3) solver, with a powerful ast level inference system. Klara will take python file as input and generate corresponding test file in pytest format, that attempt to cover all return values.
  • CrossHair - An analysis tool for Python that blurs the line between testing and type systems.

Speed

  • Partial Testing - Run only the tests that are relevant for your changes
  • pytest-testmon - Selects tests affected by changed files. Continuous test runner when used with pytest-watch.
  • pytest-incremental - pytest-incremental analyses your project structure and file modifications between test-runs to modify the order tests are executed and de-select tests. This allows a much faster feedback for interactive test execution.

Related

  • Awesome Python - A curated list of awesome Python frameworks, libraries, software and resources.
  • Python test automation - A comprehensive curated list of python test automation frameworks, tools, libraries and software to help software engineers easily bootstrap test automation on python.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].