diff --git a/src/flask/scaffold.py b/src/flask/scaffold.py index 6af6906a..9d3498fc 100644 --- a/src/flask/scaffold.py +++ b/src/flask/scaffold.py @@ -865,7 +865,7 @@ def _find_package_path(import_name): if hasattr(loader, "get_filename"): filename = loader.get_filename(root_mod_name) elif hasattr(loader, "archive"): - # zipimporter's loader.archive points to the .egg or .zip file. + # zipimporter's loader.archive points to the .zip file. filename = loader.archive else: # At least one loader is missing both get_filename and archive: diff --git a/tests/conftest.py b/tests/conftest.py index a4168f2e..6dcb1a08 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,6 @@ import os import pkgutil import sys -import textwrap import pytest from _pytest import monkeypatch @@ -154,42 +153,6 @@ def site_packages(modules_tmpdir, monkeypatch): return rv -@pytest.fixture -def install_egg(modules_tmpdir, monkeypatch): - """Generate egg from package name inside base and put the egg into - sys.path.""" - - def inner(name, base=modules_tmpdir): - base.join(name).ensure_dir() - base.join(name).join("__init__.py").ensure() - - egg_setup = base.join("setup.py") - egg_setup.write( - textwrap.dedent( - f""" - from setuptools import setup - setup( - name="{name}", - version="1.0", - packages=["site_egg"], - zip_safe=True, - ) - """ - ) - ) - - import subprocess - - subprocess.check_call( - [sys.executable, "setup.py", "bdist_egg"], cwd=str(modules_tmpdir) - ) - (egg_path,) = modules_tmpdir.join("dist/").listdir() - monkeypatch.syspath_prepend(str(egg_path)) - return egg_path - - return inner - - @pytest.fixture def purge_module(request): def inner(name): diff --git a/tests/test_instance_config.py b/tests/test_instance_config.py index c8cf0bf7..3b72a265 100644 --- a/tests/test_instance_config.py +++ b/tests/test_instance_config.py @@ -1,5 +1,3 @@ -import sys - import pytest import flask @@ -107,19 +105,3 @@ def test_prefix_package_paths( assert site_package.app.instance_path == modules_tmpdir.join("var").join( "site_package-instance" ) - - -def test_egg_installed_paths(install_egg, modules_tmpdir, modules_tmpdir_prefix): - modules_tmpdir.mkdir("site_egg").join("__init__.py").write( - "import flask\n\napp = flask.Flask(__name__)" - ) - install_egg("site_egg") - try: - import site_egg - - assert site_egg.app.instance_path == str( - modules_tmpdir.join("var/").join("site_egg-instance") - ) - finally: - if "site_egg" in sys.modules: - del sys.modules["site_egg"]