(monkeypatch, app)
| 1883 | |
| 1884 | |
| 1885 | def test_run_server_port(monkeypatch, app): |
| 1886 | rv = {} |
| 1887 | |
| 1888 | # Mocks werkzeug.serving.run_simple method |
| 1889 | def run_simple_mock(hostname, port, application, *args, **kwargs): |
| 1890 | rv["result"] = f"running on {hostname}:{port} ..." |
| 1891 | |
| 1892 | monkeypatch.setattr(werkzeug.serving, "run_simple", run_simple_mock) |
| 1893 | hostname, port = "localhost", 8000 |
| 1894 | app.run(hostname, port, debug=True) |
| 1895 | assert rv["result"] == f"running on {hostname}:{port} ..." |
| 1896 | |
| 1897 | |
| 1898 | @pytest.mark.parametrize( |