Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jupe/pytest-lockable
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.5
Choose a base ref
...
head repository: jupe/pytest-lockable
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 7 files changed
  • 4 contributors

Commits on Oct 23, 2021

  1. Copy the full SHA
    79c00b3 View commit details

Commits on Nov 9, 2021

  1. Copy the full SHA
    50cfe2b View commit details
  2. Create dependabot.yml

    jupe authored Nov 9, 2021
    Copy the full SHA
    2d5a769 View commit details
  3. Bump lockable from 0.7.0 to 0.7.1 (#24)

    Bumps [lockable](https://github.com/jupe/pytest-lockable) from 0.7.0 to 0.7.1.
    - [Release notes](https://github.com/jupe/pytest-lockable/releases)
    - [Commits](v0.7.0...v0.7.1)
    
    ---
    updated-dependencies:
    - dependency-name: lockable
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 9, 2021
    Copy the full SHA
    a84896c View commit details
  4. lockable>=0.7.1,<0.8.0 (#25)

    * lockable>=0.7.1,<0.8.0
    juhhov authored Nov 9, 2021
    Copy the full SHA
    3e0ff18 View commit details

Commits on Feb 28, 2022

  1. Copy the full SHA
    3fcbc79 View commit details

Commits on Jul 20, 2022

  1. Copy the full SHA
    cf8bfca View commit details

Commits on Aug 9, 2023

  1. CI to run py310 (#31)

    jupe authored Aug 9, 2023
    Copy the full SHA
    0d5329f View commit details
  2. update dep:lockable (#30)

    jupe authored Aug 9, 2023
    Copy the full SHA
    48fd628 View commit details

Commits on Nov 6, 2023

  1. Copy the full SHA
    1dd1eae View commit details
  2. add dependabot.yml

    jupe authored Nov 6, 2023
    Copy the full SHA
    ce979ec View commit details

Commits on Jan 24, 2024

  1. update py-lockable dependency and drop py 3.7 support (#34)

    * update py-lockable dep
    * drop py3.7
    jupe authored Jan 24, 2024
    Copy the full SHA
    c101e07 View commit details
Showing with 32 additions and 32 deletions.
  1. +11 −11 .circleci/config.yml
  2. +11 −0 .github/dependabot.yml
  3. +0 −5 README.md
  4. +0 −7 example/conftest.py
  5. +1 −1 example/test_example.py
  6. +4 −4 pytest_lockable/plugin.py
  7. +5 −4 setup.py
22 changes: 11 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -8,23 +8,23 @@ workflows:
version: 2
test:
jobs:
- test-37:
- test-38:
filters:
tags:
only: /.*/
- test-38:
- test-39:
filters:
tags:
only: /.*/
- test-39:
- test-310:
filters:
tags:
only: /.*/
- deploy:
requires:
- test-310
- test-39
- test-38
- test-37
filters:
tags:
only: /^v.*/
@@ -53,9 +53,9 @@ commands:
key: deps1-{{ .Branch }}-{{ checksum "setup.py" }}

jobs:
test-37: &test-template
test-38: &test-template
docker:
- image: circleci/python:3.7
- image: circleci/python:3.8
working_directory: ~/pytest-lockable
steps:
- setup
@@ -87,15 +87,15 @@ jobs:
path: junit
destination: juni

test-38:
test-39:
<<: *test-template
docker:
- image: circleci/python:3.8

test-39:
- image: circleci/python:3.9
test-310:
<<: *test-template
docker:
- image: circleci/python:3.9-rc-buster
- image: circleci/python:3.10

deploy:
<<: *test-template
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -42,11 +42,6 @@ pytest --allocation_hostname localhost -s --allocation_requirements os=Android m
pip install pytest-lockable
```

`conftest.py`:

```
pytest_plugins = ("lockable.plugin",)
```

## integrations

7 changes: 0 additions & 7 deletions example/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
""" example conftest """
import sys
import os
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
PLUGIN_DIR = os.path.join(TEST_DIR, '../')
sys.path.insert(0, PLUGIN_DIR)

pytest_plugins = ("pytest_lockable.plugin", "metadata") # pylint: disable=invalid-name
2 changes: 1 addition & 1 deletion example/test_example.py
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 4 additions & 4 deletions pytest_lockable/plugin.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ def pytest_addoption(parser):
group.addoption("--allocation_lock_folder", default=tempfile.gettempdir(), help="Allocation lockfiles folder")


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(scope="session")
def lockable(pytestconfig):
"""
pytest fixture that yields function for allocate any resource
@@ -36,15 +36,15 @@ def test_foo(lockable):
yield _lockable


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(scope="session")
def lockable_resource(pytestconfig, lockable): # pylint: disable=redefined-outer-name
"""
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
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -42,20 +42,21 @@
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.7',
"Programming Language :: Python :: 3 :: Only",
],
packages=find_packages(exclude=['tests']),
keywords="py.test pytest lockable resource",
python_requires='>=3.7, <4',
entry_points={"pytest11": ["pytest_lockable = pytest_lockable.plugin"]},
python_requires='>=3.8, <4',
install_requires=[
'pytest',
'lockable==0.6.0'
'lockable>=0.11.0,<0.12.0'
],
extras_require={ # Optional
'dev': ['nose', 'coveralls', 'pylint', 'coverage'],
'dev': ['pynose', 'coveralls', 'pylint', 'coverage'],
'optional': ['pytest-metadata']
},