Merge pull request #173 from bertjwregeer/bugfix/multiple_servers

Allow creating multiple servers using Paste
This commit is contained in:
Matthew Planchard 2017-09-19 08:56:21 -05:00 committed by GitHub
commit d62d81309b
2 changed files with 9 additions and 3 deletions

@ -1,4 +1,5 @@
import re as _re
import sys
version = __version__ = "1.2.1.dev0"
__version_info__ = tuple(_re.split('[.-]', __version__))
@ -120,7 +121,10 @@ def app(**kwds):
:func:`default_config()`. Check the docstring of this function
for supported kwds.
"""
from . import core, _app
from . import core
_app = __import__("_app", globals(), locals(), ["."], 1)
sys.modules.pop('pypiserver._app', None)
kwds = default_config(**kwds)
config, packages = core.configure(**kwds)

@ -35,5 +35,7 @@ def test_paste_app_factory(conf_options, monkeypatch):
lambda **x: (x, [x.keys()]))
pypiserver.paste_app_factory({}, **conf_options)
def test_app_factory(monkeypatch):
monkeypatch.setattr('pypiserver.core.configure',
lambda **x: (x, [x.keys()]))
assert pypiserver.app() is not pypiserver.app()