from io import StringIO from paste.__main__ import main def test_cli(monkeypatch): monkeypatch.setattr("paste.__main__.db", None) monkeypatch.setattr("paste.__main__.application", None) monkeypatch.setattr("paste.__main__.store", None) monkeypatch.setenv("PASTE_DB", "test_value") buf = StringIO() main(["paste", "--help"], stderr=buf) assert "paste" in buf.getvalue()