(*args, cli_mode: bool = True)
| 209 | from httpie.plugins.registry import plugin_manager |
| 210 | |
| 211 | def runner(*args, cli_mode: bool = True): |
| 212 | args = list(args) |
| 213 | if cli_mode: |
| 214 | args.insert(0, 'cli') |
| 215 | args.insert(cli_mode, 'plugins') |
| 216 | |
| 217 | # Prevent installed plugins from showing up. |
| 218 | original_plugins = plugin_manager.copy() |
| 219 | clean_sys_path = set(sys.path).difference(site.getsitepackages()) |
| 220 | with patch('sys.path', list(clean_sys_path)): |
| 221 | response = httpie(*args, env=interface.environment) |
| 222 | plugin_manager.clear() |
| 223 | plugin_manager.extend(original_plugins) |
| 224 | return response |
| 225 | |
| 226 | return runner |
| 227 |
nothing calls this directly
no test coverage detected