|
|
@ -21,19 +21,18 @@ from flask._compat import PY2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True) |
|
|
|
@pytest.fixture(autouse=True) |
|
|
|
def disable_extwarnings(request, recwarn): |
|
|
|
def disable_extwarnings(recwarn): |
|
|
|
from flask.exthook import ExtDeprecationWarning |
|
|
|
from flask.exthook import ExtDeprecationWarning |
|
|
|
|
|
|
|
|
|
|
|
def inner(): |
|
|
|
yield |
|
|
|
|
|
|
|
|
|
|
|
assert set(w.category for w in recwarn.list) \ |
|
|
|
assert set(w.category for w in recwarn.list) \ |
|
|
|
<= set([ExtDeprecationWarning]) |
|
|
|
<= set([ExtDeprecationWarning]) |
|
|
|
recwarn.clear() |
|
|
|
recwarn.clear() |
|
|
|
|
|
|
|
|
|
|
|
request.addfinalizer(inner) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True) |
|
|
|
@pytest.fixture(autouse=True) |
|
|
|
def importhook_setup(monkeypatch, request): |
|
|
|
def importhook_setup(monkeypatch): |
|
|
|
# we clear this out for various reasons. The most important one is |
|
|
|
# we clear this out for various reasons. The most important one is |
|
|
|
# that a real flaskext could be in there which would disable our |
|
|
|
# that a real flaskext could be in there which would disable our |
|
|
|
# fake package. Secondly we want to make sure that the flaskext |
|
|
|
# fake package. Secondly we want to make sure that the flaskext |
|
|
@ -58,13 +57,12 @@ def importhook_setup(monkeypatch, request): |
|
|
|
import_hooks += 1 |
|
|
|
import_hooks += 1 |
|
|
|
assert import_hooks == 1 |
|
|
|
assert import_hooks == 1 |
|
|
|
|
|
|
|
|
|
|
|
def teardown(): |
|
|
|
yield |
|
|
|
|
|
|
|
|
|
|
|
from flask import ext |
|
|
|
from flask import ext |
|
|
|
for key in ext.__dict__: |
|
|
|
for key in ext.__dict__: |
|
|
|
assert '.' not in key |
|
|
|
assert '.' not in key |
|
|
|
|
|
|
|
|
|
|
|
request.addfinalizer(teardown) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture |
|
|
|
@pytest.fixture |
|
|
|
def newext_simple(modules_tmpdir): |
|
|
|
def newext_simple(modules_tmpdir): |
|
|
|