pytest-splitio
Split.io SDK integration for e2e tests
Requirements
Pytest >= 5.0
splitio_client >= 8.0
Installation
You can install “pytest-splitio” via pip from PyPI:
$ pip install pytest-splitio
Usage
There are two types of markers - skipif_split_not_equal and skipif_split_equals.
This test will be skipped if ‘cool-split-name’ split’s value is not equal to “on” value in environment
import pytest
@pytest.mark.skipif_split_not_equal('cool-split-name', 'on')
def test_m1():
pass
This test will be skipped if ‘cool-split-name’ split’s value is equal to “off” value
import pytest
@pytest.mark.skipif_split_equals('cool-split-name', 'off')
def test_m2():
pass
You can also add some logic inside your test, by checking split’s treatment value
Make sure to pass ‘split’ argument to your test function
def test_m3(split):
split_treatment = split.get_treatment('cool-split-name')
if split_treatment == 'on':
print('YES!!!')
Now to Run your tests you need to specify –SPLIT-KEY argument or create an environment variable SPLIT_KEY, which should be environment SDK key:
$ python -m pytest --SPLIT-KEY="your-split-sdk-key"
Contributing
Contributions are very welcome.
License
Distributed under the terms of the MIT license, “pytest-splitio” is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Metadata
Release files for pytest-splitio 0.1.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 | Provenance | Actions |
|---|---|---|---|---|
| pytest-splitio-0.1.0.tar.gz | 3.4 kB | Without provenance | Details for pytest-splitio-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_splitio-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_splitio-0.1.0-py3-none-any.whl |
Total release size: 6.6 kB
Release files / pytest-splitio-0.1.0.tar.gz
| Download URL | pytest-splitio-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1e42b59837d0ff1ed844145cdbcc3963a51c30ada11554e2d0eb710fd4695e3
|
|
BLAKE2b-256 checksum How to use checksums |
7e5d1116d635043eb85ef022d248922b952c05ebb61f65fff243982257b89e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / pytest_splitio-0.1.0-py3-none-any.whl
| Download URL | pytest_splitio-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7610044fd9d67c3ec76269aca9f4cb1dcacba3b545101f10f559ea68c1415d15
|
|
BLAKE2b-256 checksum How to use checksums |
6a5df7865e6a040b62cd89e9eb86f3a3da9cbc4a6d46ffb7e65f7b743ee55f64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Security for pytest-splitio 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.