v0.1.0: CRM/ERP 系统内测版本 - 安全加固完成
- Docker bridge 网络隔离(8000 端口封死) - Gunicorn 4 Worker 多进程 - Alembic 数据库迁移基线 - 日志轮转 20m×3 - JWT 密钥 + DB 密码 + CORS 收紧 - 3-2-1 备份链路(NAS + R740-B 冷备) - 连接池 pool_pre_ping + pool_recycle=3600
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
import pytest
|
||||
|
||||
from mako.ext.beaker_cache import has_beaker
|
||||
from mako.util import update_wrapper
|
||||
|
||||
|
||||
try:
|
||||
import babel.messages.extract as babel
|
||||
except ImportError:
|
||||
babel = None
|
||||
|
||||
|
||||
try:
|
||||
import lingua
|
||||
except ImportError:
|
||||
lingua = None
|
||||
|
||||
|
||||
try:
|
||||
import dogpile.cache # noqa
|
||||
except ImportError:
|
||||
has_dogpile_cache = False
|
||||
else:
|
||||
has_dogpile_cache = True
|
||||
|
||||
|
||||
requires_beaker = pytest.mark.skipif(
|
||||
not has_beaker, reason="Beaker is required for these tests."
|
||||
)
|
||||
|
||||
|
||||
requires_babel = pytest.mark.skipif(
|
||||
babel is None, reason="babel not installed: skipping babelplugin test"
|
||||
)
|
||||
|
||||
|
||||
requires_lingua = pytest.mark.skipif(
|
||||
lingua is None, reason="lingua not installed: skipping linguaplugin test"
|
||||
)
|
||||
|
||||
|
||||
requires_dogpile_cache = pytest.mark.skipif(
|
||||
not has_dogpile_cache,
|
||||
reason="dogpile.cache is required to run these tests",
|
||||
)
|
||||
|
||||
|
||||
def _pygments_version():
|
||||
try:
|
||||
import pygments
|
||||
|
||||
version = pygments.__version__
|
||||
except:
|
||||
version = "0"
|
||||
return version
|
||||
|
||||
|
||||
requires_pygments_14 = pytest.mark.skipif(
|
||||
_pygments_version() < "1.4", reason="Requires pygments 1.4 or greater"
|
||||
)
|
||||
|
||||
|
||||
# def requires_pygments_14(fn):
|
||||
|
||||
# return skip_if(
|
||||
# lambda: version < "1.4", "Requires pygments 1.4 or greater"
|
||||
# )(fn)
|
||||
|
||||
|
||||
def requires_no_pygments_exceptions(fn):
|
||||
def go(*arg, **kw):
|
||||
from mako import exceptions
|
||||
|
||||
exceptions._install_fallback()
|
||||
try:
|
||||
return fn(*arg, **kw)
|
||||
finally:
|
||||
exceptions._install_highlighting()
|
||||
|
||||
return update_wrapper(go, fn)
|
||||
Reference in New Issue
Block a user