Skip to main content
https://badge.fury.io/py/yandex-taxi-testsuite.svg https://github.com/yandex/yandex-taxi-testsuite/actions/workflows/ci.yml/badge.svg?branch=develop https://github.com/yandex/yandex-taxi-testsuite/actions/workflows/macos-ci.yml/badge.svg?branch=develop

What is testsuite

Testsuite is a microservice-oriented test framework written in Python based on pytest.

Testsuite is written and supported by Yandex.Taxi, and is used to test Yandex.Taxi microservices written in C++ and Python.

The principal suggested approach to testing - although not the only one - is black box, when the service is tested through http calls.

Direct read and write access from test to database is supported to enable precondition setup and result assertions.

Installation

Installation using pip:

pip3 install yandex-taxi-testsuite

# testsuite with mongodb support
pip3 install yandex-taxi-testsuite[mongodb]

# testsuite with postgresql support
pip3 install yandex-taxi-testsuite[postgresql]
pip3 install yandex-taxi-testsuite[postgresql-binary]

# testsuite with redis support
pip3 install yandex-taxi-testsuite[redis]

# testsuite with mysql support
pip3 install yandex-taxi-testsuite[mysql]

# testsuite with clickhouse support
pip3 install yandex-taxi-testsuite[clickhouse]

# testsuite with rabbitmq support
pip3 install yandex-taxi-testsuite[rabbitmq]

# testsuite with kafka support
pip3 install yandex-taxi-testsuite[kafka]

# testsuite with protobuf support
pip3 install yandex-taxi-testsuite[protobuf]

Supported databases

Out-of-the-box testsuite supports the following databases:

  • PostgreSQL

  • MongoDB

  • Redis/Valkey

  • MySQL/MariaDB 10+

  • ClickHouse

  • RabbitMQ

Supported operating systems

Testsuite runs on GNU/Linux and macOS operating systems.

Principle of operation

Testsuite sets up the environment for the service being tested:

  • Testsuite starts any required databases (postgresql, mongo, redis).

  • Before each test, testsuite fills the database with test data.

  • Testsuite starts its own web server (mockserver), which mimics (mocks) microservices other than the one being tested.

Testsuite starts the microservice being tested in a separate process.

Testsuite then runs tests.

A test performs http requests to the service and verifies that the requests were processed properly.

A test may check the results of an http call by looking directly into the service’s database.

A test may check whether the service has made calls to external services, as well as the order of calls and the data that was sent and received.

A test may check the internal state of the service as represented by the data the service sent to the test with the testpoint mechanism.

Source code

Testsuite open-source edition code is available here.

Documentation

For full documentation, including installation, tutorials, please see https://yandex.github.io/yandex-taxi-testsuite/.

Running testsuite

self-tests:

pytest3 ./tests

tests of example services:

cd docs/examples && make

Development

Setup virtual env

In order to test your modifications it’s useful to run testsuite inside virtualenv. Use the following command to create developer’s venv:

make setup-dev-venv

Virtualenv will be created in .venv-dev directory.

Code format and linters

Auto format source code:

make venv-format

Run linters:

make venv-check-linters
make venv-check-mypy

You can also add pre-commit hook which will run ruff and linters for you:

make install-pre-commit-hooks

Running tests

You can run tests using Makefile:

make venv-tests

Or directly using pytest:

make setup-dev-venv                  # Setup virtual env first
. .venv-dev/bin/activate             # Activate virtualenv
pytest -vv tests/plugins/mockserver  # Finally run pytest

Building documentation

make build-docs

Contributing

  • Fork project

  • Write code in your own branch

  • Test your code

  • Run linters and code formatters

  • Add new changelog entry

  • Create pull request on github

Release files for yandex-taxi-testsuite 0.4.9

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

Source distribution (sdist)

Source distribution for yandex-taxi-testsuite 0.4.9
File Size Uploaded
yandex_taxi_testsuite-0.4.9.tar.gz 113.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yandex-taxi-testsuite 0.4.9
File Interpreter ABI Platform
yandex_taxi_testsuite-0.4.9-py3-none-any.whl Python 3 none any Details

Total release size: 261.8 kB

Release files / yandex_taxi_testsuite-0.4.9.tar.gz

Download URL yandex_taxi_testsuite-0.4.9.tar.gz
Size 113.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cfaa3e8881e0a4e1d871e34aadad34177f2ba089319bd6765474d4fb0ac08fb6
BLAKE2b-256 checksum
How to use checksums
c17f726f1a5137aae44fc942a937dcc429097731e380bee03179e850fa7c4a90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / yandex_taxi_testsuite-0.4.9-py3-none-any.whl

Download URL yandex_taxi_testsuite-0.4.9-py3-none-any.whl
Size 148.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9788b7a7f2028437aa6e330e348bc33c58035734f2e1a91dc0456da62e70855c
BLAKE2b-256 checksum
How to use checksums
d48aada4bb4723dc61fbbb7136faceefbfa8f223b1d9414abd646f5a93005abe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.4.11

2 release files

0.4.10

2 release files

This release

0.4.9 This release

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.41

2 release files

0.1.40

2 release files

0.1.39

2 release files

0.1.36

2 release files

0.1.35

2 release files

0.1.34

2 release files

0.1.33

2 release files

0.1.32

2 release files

0.1.29

2 release files

0.1.25

2 release files

0.1.24

2 release files

0.1.23

2 release files

0.1.22

2 release files

0.1.21

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.12

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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