(monkeypatch, app)
| 1855 | |
| 1856 | |
| 1857 | def test_run_server_port(monkeypatch, app): |
| 1858 | rv = {} |
| 1859 | |
| 1860 | # Mocks werkzeug.serving.run_simple method |
| 1861 | def run_simple_mock(hostname, port, application, *args, **kwargs): |
| 1862 | rv["result"] = f"running on {hostname}:{port} ..." |
| 1863 | |
| 1864 | monkeypatch.setattr(werkzeug.serving, "run_simple", run_simple_mock) |
| 1865 | hostname, port = "localhost", 8000 |
| 1866 | app.run(hostname, port, debug=True) |
| 1867 | assert rv["result"] == f"running on {hostname}:{port} ..." |
| 1868 | |
| 1869 | |
| 1870 | @pytest.mark.parametrize( |