-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
test_instance_config.py fails #3151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This appears to be an issue with the upgrade from pytest 4.3.1 to 4.4.0. Downgrade and the tests pass. @blueyed @nicoddemus I think the issue came from pytest-dev/pytest#4980 because the tests that are failing here use a fixture that uses |
Does commenting https://github.com/pytest-dev/pytest/pull/4980/files#diff-1f034a0f101912ca729b09e39a3973bbR272 fix the tests then? |
Yes, commenting out that line allows the tests to pass again. |
Hmm.. inside of tox it passes at least, right? And with e.g. Will look into it later.. |
This fixes it (for diff --git i/tests/test_instance_config.py w/tests/test_instance_config.py
index bc912c64..a7b66203 100644
--- i/tests/test_instance_config.py
+++ w/tests/test_instance_config.py
@@ -26,6 +26,8 @@ def test_explicit_instance_paths(modules_tmpdir):
def test_main_module_paths(modules_tmpdir, purge_module):
app = modules_tmpdir.join('main_app.py')
+ from importlib import invalidate_caches
+ invalidate_caches()
app.write('import flask\n\napp = flask.Flask("__main__")')
purge_module('main_app')
E.g. here it is also needed, likely due to some other fixture: diff --git i/tests/test_instance_config.py w/tests/test_instance_config.py
index bc912c64..1f2be9ce 100644
--- i/tests/test_instance_config.py
+++ w/tests/test_instance_config.py
@@ -94,6 +94,8 @@ def test_installed_package_paths(limit_loader, modules_tmpdir,
def test_prefix_package_paths(limit_loader, modules_tmpdir,
modules_tmpdir_prefix, purge_module,
site_packages):
+ from importlib import invalidate_caches
+ invalidate_caches()
app = site_packages.mkdir('site_package')
init = app.join('__init__.py')
init.write('import flask\napp = flask.Flask(__name__)') |
|
pytest-dev/pytest#5098 fixes it. |
Uh oh!
There was an error while loading. Please reload this page.
Expected Behavior
The following set of commands should result in all tests being passed or skipped (no failures).
Actual Behavior
I get the following failures:
Environment
Ubuntu 18 LTS.
Here's the result of
ls
in theflask
directory:The text was updated successfully, but these errors were encountered: