Skip to content

Conversation

@sturmianseq
Copy link
Contributor

Like #36, this PR aims to improve reliability of the test test_add_module by cleaning the state before running it.

The test can fail on the second run by running it twice: pip3 install pytest-repeat; python3 -m pytest --count=2 tests/test_operator.py::Test_operator::test_add_module.

    def test_add_module(self):
        global cli_UUID
>       cli_UUID = vlx.add_module(cli_module)

tests/test_operator.py:13
...
>               raise Exception(
                    "this instance of module '{}' is already loaded! [{}{}{}]".format(
                        module._module_name,
                        colorama.Fore.GREEN,
                        module.UUID,
                        colorama.Style.RESET_ALL,
                    )
                )
E               Exception: this instance of module 'Volux CLI Print' is already loaded! [60cf3f79-fe57-4202-b644-7e881da16e12]
volux/operator.py:69: Exception

More specifically, this PR cleans the pre-state by ensuring that the cli_module is not in vlx.modules. In this way, the test does not fail on the second run any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant