pallets / flask

The Python micro framework for building web applications.

Home Page:https://flask.palletsprojects.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run tests without installing it

catap opened this issue · comments

An attempt to run test without installing flask leads to fail:

:info:test cls = <class 'importlib.metadata.Distribution'>, name = 'flask'
:info:test     @classmethod
:info:test     def from_name(cls, name):
:info:test         """Return the Distribution for the given package name.
:info:test     
:info:test         :param name: The name of the distribution package to search for.
:info:test         :return: The Distribution instance (or subclass thereof) for the named
:info:test             package, if found.
:info:test         :raises PackageNotFoundError: When the named package's distribution
:info:test             metadata cannot be found.
:info:test         """
:info:test         for resolver in cls._discover_resolvers():
:info:test             dists = resolver(DistributionFinder.Context(name=name))
:info:test             dist = next(dists, None)
:info:test             if dist is not None:
:info:test                 return dist
:info:test         else:
:info:test >           raise PackageNotFoundError(name)
:info:test E           importlib.metadata.PackageNotFoundError: flask
:info:test /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/metadata.py:177: PackageNotFoundError
:info:test ========================================================================================== short test summary info ==========================================================================================
:info:test FAILED tests/test_cli.py::test_get_version - importlib.metadata.PackageNotFoundError: flask
:info:test ================================================================================= 1 failed, 468 passed, 7 skipped in 2.68s ==================================================================================

That's correct, as explained in the contributing guide.