Pytest-Sosu
Pytest-Sosu (pronounced Sōsu, ソース) is an unofficial Pytest plugin for running tests on Sauce Labs platforms.
Installation
You can install pytest-sosu latest version via pip:
pip install pytest-sosu
Basic Usage
Assuming you have SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables set
(credentials can be obtained here),
you can write a simple test:
def test_visit(sosu_webdriver):
driver = sosu_webdriver
driver.get("http://example.com/")
assert driver.title == "Example Domain"
Examples
from pytest_sosu.webdriver import CapabilitiesMatrix, Browser
# running given test on multiple browsers
@pytest.mark.sosu(
capabilities_matrix=CapabilitiesMatrix(
browsers=[Browser("chrome"), Browser("firefox")],
),
)
def test_visit_many_browsers(driver):
driver.get("http://example.com/")
assert driver.title == "Example Domain"
# when build basename is set, tests running in given pytest session
# have a build assigned
@pytest.fixture(scope="session")
def sosu_build_basename():
return 'my-project-name'
# alias for sosu_webdriver
@pytest.fixture
def driver(sosu_webdriver):
yield sosu_webdriver
Metadata
Release files for pytest-sosu 0.1.3
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-sosu-0.1.3.tar.gz | 11.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_sosu-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / pytest-sosu-0.1.3.tar.gz
| Download URL | pytest-sosu-0.1.3.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87088e2f6e32ed969f0002522dcf98055249ab6225e92408b820dc9091c960d7
|
|
BLAKE2b-256 checksum How to use checksums |
82de541b5b5acd2bebb020cbc9d81828ebbdbf3df3b0905062a15765d2a4f841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|
Release files / pytest_sosu-0.1.3-py3-none-any.whl
| Download URL | pytest_sosu-0.1.3-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
324d6c6c990114b81f647e0accbfb1ee577e663a869c4242a9ae63e005ca3748
|
|
BLAKE2b-256 checksum How to use checksums |
66edc8fd9d05bd9ab0f4d0b758d4dfa7cf67c213d2c18c18c91f940858c9f8da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|