|
|
@ -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) \ |
|
|
|
|
|
|
|
<= set([ExtDeprecationWarning]) |
|
|
|
|
|
|
|
recwarn.clear() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.addfinalizer(inner) |
|
|
|
assert set(w.category for w in recwarn.list) \ |
|
|
|
|
|
|
|
<= set([ExtDeprecationWarning]) |
|
|
|
|
|
|
|
recwarn.clear() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@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,12 +57,11 @@ 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 |
|
|
|
|
|
|
|
for key in ext.__dict__: |
|
|
|
|
|
|
|
assert '.' not in key |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.addfinalizer(teardown) |
|
|
|
from flask import ext |
|
|
|
|
|
|
|
for key in ext.__dict__: |
|
|
|
|
|
|
|
assert '.' not in key |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture |
|
|
|
@pytest.fixture |
|
|
|