Skip to main content

pytest-tipsi-testing

Installation

pytest-tipsi-testing is distributed on PyPI as a universal wheel and is available on Linux/macOS and Windows and supports Python 3.5+.

$ pip install pytest-tipsi-testing

License

pytest-tipsi-testing is distributed under the terms of the MIT License.

Motivation and features

We want to make fixtures more predictable in pytest. So this plugin ensures that only loaded fixtures will be available when test is running.

Currently pytest allows fixtures with bigger scopes (session, module and etc.) to be instantiated even if test doesn’t directly require them. This may cause some troubles in several cases, for example if you wan’t to create some kind of cache in bigger fixture.

This means that all not required fixtures will be finished before test is started: even with bigger scope. So if you want to have some fixtures always awailable (eg. docker_start fixture with session scope) - you should make it autoused.

Also we’re forcing correct order for fixtures with different scopes: session -> module -> class -> function.

Usecase

In conjunction with pytest-tipsi-django you can make fixtures on different level than scope and share the same database state across different tests. It’s quit helpful when you perform complex and long database setup and want to have small and readable test cases.

Please see pytest-tipsi-django documentation for more detailed description.

Fixtures

vprint

Print that works only when verbose mode is enabled -v.

Note: you should add -s to see the output.

log_requests

Use it when you want to write down all request/responses made with requests library. By default it will put docs into .doc dir or other directory supplied by DOCS_ROOT environmental variable.

def example(log_requests):
  import requests
  with log_request('out_file'):
    r = requests.get('http://echo.jsontest.com/key/value/one/two')
    assert r.status_code == 200, r

It will put json file into your .doc/{MODULE_PATH}.out_file.json, in my case it was a .doc/tests.test_log_requests.out.json your case may be different depending on module you have used it in.

Metadata

Release files for pytest-tipsi-testing 1.4.3

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

Source distribution (sdist)

Source distribution for pytest-tipsi-testing 1.4.3
File Size Uploaded
pytest_tipsi_testing-1.4.3.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-tipsi-testing 1.4.3
File Interpreter ABI Platform
pytest_tipsi_testing-1.4.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 10.6 kB

Release files / pytest_tipsi_testing-1.4.3.tar.gz

Download URL pytest_tipsi_testing-1.4.3.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a580926c6a2569d25b402d9ed99f1cf82ce82f7c3e6f50b2b6b66cc5b5798ed0
BLAKE2b-256 checksum
How to use checksums
5c96fd7c5af9c482fc52da768704125f95fec857df10e4e368dc7f4a3c65f64e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release files / pytest_tipsi_testing-1.4.3-py2.py3-none-any.whl

Download URL pytest_tipsi_testing-1.4.3-py2.py3-none-any.whl
Size 5.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2bbdc8fe73f0432ade0f6d095761ee4570f8e2191ec9e63af1edc76bea5bbb67
BLAKE2b-256 checksum
How to use checksums
e6f03a6f40285c20cdd5596865fb1c2a65ce1297a635dca3f12ec254d6678e87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release history Release notifications | RSS feed

This release

1.4.3 This release

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

2 release files

0.2.0

2 release files

0.1.1

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