Closed dollysingh31 closed 4 years ago
Did you try putting something like this in your test:
assert x != y
In the above line, if x is equal to y then the assert fails and the test will fail. As an example see the test case here: https://github.com/lgirdk/boardfarm/blob/master/boardfarm/tests/ping6.py#L22
Another way of saying it is that for a test to fail, it has to raise an exception. So doing a raise Exception("The variables were not equal!")
would work too.
Yes, I tried by using an exception. Its working now. Thanks for the support.
I am trying to run a test case which will compare the SSID of the 2 devices which I connected locally. I can see that even when the comparison fails it is passing the case, which should not be done ideally.
Is there a command to fail the test case if the requirements doesn't match? If yes, Is it possible to give the required command from the test case itself by adding to a function?