test error message in test_invalid_enviroment_variables_config test.

This commit is contained in:
Hasan Ramezni 2017-01-17 00:08:12 +03:30 committed by Berker Peksag
parent 79a9697df2
commit e007601f0d

View File

@ -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")