diff --git a/threagile-builder/tests/conftest.py b/threagile-builder/tests/conftest.py new file mode 100644 index 0000000..56b25b2 --- /dev/null +++ b/threagile-builder/tests/conftest.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2024-present Willem van Heemstra +# +# SPDX-License-Identifier: MIT +import pytest +from click.testing import CliRunner as __CliRunner + + +class CliRunner(__CliRunner): + def __init__(self, command): + super().__init__() + self._command = command + + def __call__(self, *args, **kwargs): + # Exceptions should always be handled + kwargs.setdefault('catch_exceptions', False) + + return self.invoke(self._command, args, **kwargs) + + +@pytest.fixture(scope='session') +def threagile_builder(): + from threagile_builder import cli + + return CliRunner(cli.threagile_builder) \ No newline at end of file