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