pytest-scim2-server
SCIM2 server fixture for Pytest
Installation
pip install pytest-scim2-server
Usage
pytest-scim2-server creates a scim2_server fixture that runs an instance of scim2-server on a random port, in a dedicated thread.
The server keeps the resources in memory, for the whole test session.
import httpx2
def test_scim_foobar(scim2_server):
res = httpx2.get(f"http://localhost:{scim2_server.port}/v2/Users")
...
Note that you can use scim2-client to interact with the SCIM server.
import pytest
from httpx2 import Client
from scim2_client.engines.httpx2 import SyncSCIMClient
@pytest.fixture(scope="session")
def scim_client(scim2_server):
http_client = Client(base_url=f"http://localhost:{scim2_server.port}/v2")
scim_client = SyncSCIMClient(http_client)
scim_client.discover()
return scim_client
def test_scim2_server(scim_client):
User = scim_client.get_resource_model("User")
user = User(user_name="bjensen@example.com")
response = scim_client.create(user)
users = scim_client.query(User)
assert users.resources[0].id == response.id
Customize the server
The server is built from three fixtures. Override one of them in a conftest.py to change the server:
scim2_server_providerreturns theScimProvider: the schemas, the resource types and the service provider configuration.scim2_server_storagereturns the storage of the resources. It keeps them in memory by default.scim2_server_servicereturns theScimService, built uponscim2_server_provider.
For instance, the following server does not support PATCH:
import pytest
from scim2_server.utils import load_default_provider
@pytest.fixture(scope="session")
def scim2_server_provider():
provider = load_default_provider()
provider.config.patch.supported = False
return provider
The fixtures are session-scoped, so an overriding fixture must be session-scoped too.
Related projects
If you are working with SCIM and Python you might also want to have a look at:
Metadata
Release files for pytest-scim2-server 0.3.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_scim2_server-0.3.0.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_scim2_server-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / pytest_scim2_server-0.3.0.tar.gz
| Download URL | pytest_scim2_server-0.3.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a106db5a2239ddafa314bda6c8eee53fc191e60f9b60eb07afcd536e126dfde1
|
|
BLAKE2b-256 checksum How to use checksums |
c1a60214bc945dc39c1c7ba133b0897ed1cbba0fe5fb8b68d27823124dda46d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / pytest_scim2_server-0.3.0-py3-none-any.whl
| Download URL | pytest_scim2_server-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e53a621ec4fcfce1a27a0f4f0840c78770c45924ab6cc0315e8b92b3bfbfd5d2
|
|
BLAKE2b-256 checksum How to use checksums |
dc11ac3b491819788027c8fc127afdb347001d37d23bb38ff8a87949b90d3a5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency log