forked from Github-Mirrors/canaille
chore: pre-commit upgrade
This commit is contained in:
parent
127d56f713
commit
e5328837fd
3 changed files with 6 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: 'v0.4.1'
|
||||
rev: 'v0.5.4'
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [--fix, --exit-non-zero-on-fix]
|
||||
|
|
|
@ -8,16 +8,16 @@ from canaille.app import classproperty
|
|||
|
||||
|
||||
class Backend:
|
||||
instance = None
|
||||
_instance = None
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
Backend.instance = self
|
||||
Backend._instance = self
|
||||
self.register_models()
|
||||
|
||||
@classproperty
|
||||
def instance(cls):
|
||||
return cls.instance
|
||||
return cls._instance
|
||||
|
||||
def init_app(self, app):
|
||||
@app.before_request
|
||||
|
|
|
@ -40,6 +40,8 @@ def pytest_generate_tests(metafunc):
|
|||
backends = available_backends()
|
||||
if metafunc.config.getoption("backend"): # pragma: no cover
|
||||
backends &= set(metafunc.config.getoption("backend"))
|
||||
|
||||
# sort so the backend list is deterministic. This makes pytest-xdist discovery possible
|
||||
backends = sorted(backends)
|
||||
|
||||
# tests in tests.backends.BACKENDNAME should only run one backend
|
||||
|
|
Loading…
Reference in a new issue