-
First Check
Example Codefrom typer.testing import CliRunner
@pytest.mark.acceptance
class TestInitCli:
def setup_method(self) -> None:
self._runner = CliRunner()
def _run_cli_with_config(self, config: dict) -> dict:
with tempfile.NamedTemporaryFile(mode="w", suffix=".yml", delete=False) as config_file:
yaml.dump(config, config_file)
config_file_path = config_file.name
with self._runner.isolated_filesystem():
result = self._runner.invoke(app, ["--config", str(config_file_path)])
return {
"exit_code": result.exit_code,
"errors": result.exception,
}DescriptionI have an acceptance test that executes a CLI application built with typer. Previously, in the test, I executed the application inside an isolated filesystem, as it creates some folders and files that I want to be temporary and don't want to be created inside the project. I've updated the dependencies, including typer, and now the method I was using, Is a similar method available with the new version? Operating SystemLinux Operating System DetailsNo response Project Version0.26.6 Python Version3.12.10 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @dimanu-py! I'm afraid we have decided to discontinue support for |
Beta Was this translation helpful? Give feedback.
Hi @dimanu-py! I'm afraid we have decided to discontinue support for
isolated_filesystem. This functionality came from Click and was undocumented in Typer's docs. It has been removed since the vendoring of Click in #1774. See also Tiangolo's comment here.