Skip to content
Myr

add test and changelog for SERVER_NAME app.run default

Before adoption: this commit came in with the history the project adopted, so no landing records it.

ref #2152

authored by David Lord · committed by David Lord · parent 1636a4c · Browse files · 2 files+19 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+19 added−0 removed

  • tests:+17 added−0 removed
  • other:+2 added−0 removed

2 files+19 added−0 removed

modified:tests/test_basic.py+17 added
1679 unmodified lines
1680 monkeypatch.setattr(werkzeug.serving, 'run_simple', run_simple_mock)1681 hostname, port = 'localhost', 80001682 app.run(hostname, port, debug=True)1683 assert rv['result'] == 'running on %s:%s ...' % (hostname, port)168416851686@pytest.mark.parametrize('host,port,expect_host,expect_port', (1687 (None, None, 'pocoo.org', 8080),1688 ('localhost', None, 'localhost', 8080),1689 (None, 80, 'pocoo.org', 80),1690 ('localhost', 80, 'localhost', 80),1691))1692def test_run_from_config(monkeypatch, host, port, expect_host, expect_port):1693 def run_simple_mock(hostname, port, *args, **kwargs):1694 assert hostname == expect_host1695 assert port == expect_port16961697 monkeypatch.setattr(werkzeug.serving, 'run_simple', run_simple_mock)1698 app = flask.Flask(__name__)1699 app.config['SERVER_NAME'] = 'pocoo.org:8080'1700 app.run(host, port)
modified:CHANGES+2 added
15 unmodified lines
16- Prevent `flask run` from showing a NoAppException when an ImportError occurs17 within the imported application module.18- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix19 ``#2118``.20- Use the``SERVER_NAME`` config if it is present as default values for21 ``app.run``. ``#2109``, ``#2152``2223Version 0.1224------------25
593 unmodified lines