Skip to content

Commit

Permalink
breaking change: provide Allocation context
Browse files Browse the repository at this point in the history
  • Loading branch information
jupe committed Oct 23, 2021
1 parent f5b066c commit d92514a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def test_example2(lockable_resource, lockable):
""" Simple test """
print(f'Testing with resource: {lockable_resource}')
with lockable.auto_lock({}) as allocation:
print(f'Testing with resource#2: {allocation.resource_info}')
print(f'Testing with resource#2: {allocation}')
sleep(1)
4 changes: 2 additions & 2 deletions pytest_lockable/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def lockable_resource(pytestconfig, lockable): # pylint: disable=redefined-oute
pytest fixture that lock suitable resource and yield it
.. code-block:: python
def test_foo(lockable_resource):
print(f'Testing with resource: {lockable_resource}')
print(f'Testing with resource: {lockable_resource.resource_info}')
"""
requirements = pytestconfig.getoption('allocation_requirements')
timeout_s = pytestconfig.getoption('allocation_timeout')
with lockable.auto_lock(requirements, timeout_s) as allocation:
yield allocation.resource_info
yield allocation
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
python_requires='>=3.7, <4',
install_requires=[
'pytest',
'lockable==0.6.0'
'lockable==0.7.0'
],
extras_require={ # Optional
'dev': ['nose', 'coveralls', 'pylint', 'coverage'],
Expand Down

0 comments on commit d92514a

Please sign in to comment.