tests |
|
|---|---|
package |
What?
pytest_yield is a plugin that allows run tests as coroutines. This means that a few tests can being executing at same time.
Why?
This is first question that engineers asking. General theory said us that each test have to be run separetelly and independently, meaning without any influence on other tests. This plugin breaks this rules at all.
So why do we need it?
Imagine we have integration tests where each test execution takes very long time. For examle test should wait for some reactions depend on initial actions. This waiting could take up to e.g. 1 hour. And even after it we need perform next action from scenario and wait more. Syncronous execution of all tests, one by one, will take huge amout of time. But what if all test cases are independent, so actions of test1 does not influence results of test2. Than make sense some how skip waiting prosess of test1 and switch execution context to test2. This actually what pytest_yield doing.
How?
Each concurrent test is suppose to be a generator. Switching of execution context is performed after each yield. Test add itself to the end of a deueue if generator is not exausted yet. After new one is pulled from left side of dequeue. Assume test have N yields, tahn it will be N times rescheduled.
Do not use with
Tests that are cross dependent. Most particular example is unittests with mocks, if test1 mock some method, this will be implicitly mocked in test2 also.
Metadata
Release files for pytest-yield 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-yield-1.0.0.zip | 16.8 kB | Details |
Release files / pytest-yield-1.0.0.zip
| Download URL | pytest-yield-1.0.0.zip |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65adad3c06af831c89f0df8c94948708b4c0adc30a23b5b88308d1e6452891b5
|
|
BLAKE2b-256 checksum How to use checksums |
056ae6846225674eabb469d052836a37c23a1fd0c1f4b5ffc7729060d8d47843
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.14
|