MCPcopy
hub / github.com/httpie/cli / test_quiet_on_python_warnings

Method test_quiet_on_python_warnings

tests/test_output.py:102–111  ·  view source on GitHub ↗
(self, test_patch, httpbin, flags, expected_warnings)

Source from the content-addressed store, hash-verified

100 # Might fail on Windows due to interference from other warnings.
101 @pytest.mark.xfail
102 def test_quiet_on_python_warnings(self, test_patch, httpbin, flags, expected_warnings):
103 def warn_and_run(*args, **kwargs):
104 warnings.warn('warning!!')
105 return ExitStatus.SUCCESS
106
107 test_patch.side_effect = warn_and_run
108 with pytest.warns(None) as record:
109 http(*flags, httpbin + '/get')
110
111 assert len(record) == expected_warnings
112
113 def test_double_quiet_on_error(self, httpbin):
114 r = http(

Callers

nothing calls this directly

Calls 1

httpFunction · 0.85

Tested by

no test coverage detected