From e007601f0dbf965810964def9982d5cbbb4d3703 Mon Sep 17 00:00:00 2001 From: Hasan Ramezni Date: Tue, 17 Jan 2017 00:08:12 +0330 Subject: [PATCH] test error message in `test_invalid_enviroment_variables_config` test. --- tests/test_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_config.py b/tests/test_config.py index 9f047657..62abb856 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -302,12 +302,13 @@ def test_load_enviroment_variables_config(monkeypatch): assert app.cfg.workers == 4 -def test_invalid_enviroment_variables_config(monkeypatch): +def test_invalid_enviroment_variables_config(monkeypatch, capsys): monkeypatch.setenv("GUNICORN_CMD_ARGS", "--foo=bar") with AltArgs(): with pytest.raises(SystemExit): NoConfigApp() - + _, err = capsys.readouterr() + assert "error: unrecognized arguments: --foo" in err def test_cli_overrides_enviroment_variables_module(monkeypatch): monkeypatch.setenv("GUNICORN_CMD_ARGS", "--workers=4")