diff --git a/src/pytest_lock/fixtures/lock.py b/src/pytest_lock/fixtures/lock.py index e1ee2c4..ab6c06d 100644 --- a/src/pytest_lock/fixtures/lock.py +++ b/src/pytest_lock/fixtures/lock.py @@ -9,6 +9,7 @@ from pytest_lock.fixtures.base import FixtureBase from pytest_lock.models.cache.lock import Lock +from pytest_lock.models.exceptions import LockException from pytest_lock.parser_file.builder import ParserFileBuilder if sys.version_info >= (3, 12): @@ -46,6 +47,10 @@ def lock(self, function: Callable, arguments: Tuple[Any, ...], extension: Option # Hides the execution of the error; the error will be visible in the test file. __tracebackhide__ = True + if not isinstance(arguments, tuple): + # Todo : Add test for invalid arguments + raise LockException("Arguments must be in a tuple\n'lock.lock(function, arguments)' -> 'lock.lock(function, (arguments,))'") + self.change_parser(extension) if self.config.ask_clean: