Skip to main content

pytest-lockable

CircleCI PyPI version Coverage Status

pytest plugin for lockable resources.

Replacement for Jenkins lockable -plugin. Locking is implemented using <resource.id>.lock files.

Resources are described in json file as array of objects. Each object has some mandatory fields but can contains any other as well. Required fields are: id, online, hostname-

Example resources.json

[
  {
    "id": "1234",
    "online": true,
    "hostname": "localhost"
  }
]

id should be unique for each resources. online describes if resource are available for allocator. Set this false if you don't want to allocate resource. hostname is used to select suitable resource by running host.

installation

Requires: python 3.7<

pip install pytest-lockable

conftest.py:

pytest_plugins = ("lockable.plugin",)

Usage

Custom options:

--allocation_hostname=<hostname>, default=<os-hostname>  Allocation host
--allocation_requirements=<requirements>                 Resource requirements to be allocate
--allocation_timeout=<timeout>, default=10               Allocation timeout in seconds
--allocation_resource_list_file=<filename>, default=resources.json 
                                                         Resource to be allocate
--allocation_lock_folder=<folder>, default= os tmp path  allocation lock folder

<requirements> can be json-string or key-value pairs. requirements have to match available resources to make allocation possible. Key-value pairs example: key=value&key2=value2

Example:

cd example
pytest --allocation_hostname localhost -s --allocation_lock_folder .  .

Metadata

Release files for pytest-lockable 0.2.0

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-lockable 0.2.0
File Size Uploaded
pytest-lockable-0.2.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-lockable 0.2.0
File Interpreter ABI Platform
pytest_lockable-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / pytest-lockable-0.2.0.tar.gz

Download URL pytest-lockable-0.2.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7153675bdbac921e7bff812b3553fa14ad3f7e92b9fede6c563c52c5c5d1e2e8
BLAKE2b-256 checksum
How to use checksums
55f6ab6d4f3a4a20bdc5b9872f53081f5734bf3bdcdc3273e1c57ade86daf1f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

Release files / pytest_lockable-0.2.0-py3-none-any.whl

Download URL pytest_lockable-0.2.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46dbb78690259d3f1e7c93e23d5ca306cbd6f68ddc80fc3e97c7e3fb54bc927a
BLAKE2b-256 checksum
How to use checksums
53c56ea77921efa9624bc6db0c22390aead3e46be960e4b6e232ff017c023593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

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