From 853740ef9bf2a6c649e200a119edccfa916b3174 Mon Sep 17 00:00:00 2001 From: sturmianseq Date: Wed, 18 Aug 2021 09:27:17 +0000 Subject: [PATCH] Improve test reliability by cleaning the state before running test_remove_missing_module --- tests/test_operator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_operator.py b/tests/test_operator.py index 6763da8..35baeaa 100644 --- a/tests/test_operator.py +++ b/tests/test_operator.py @@ -27,9 +27,12 @@ def test_remove_module(self): assert not (cli_UUID in vlx.modules) def test_remove_missing_module(self): + global cli_UUID + if cli_UUID in vlx.modules: + vlx.remove_module(cli_module) with pytest.raises(AttributeError): vlx.remove_module(cli_module) - vlx.add_module(cli_module) + cli_UUID = vlx.add_module(cli_module) def test_validate_module(self): assert vlx.validate_module(vlx) is False