Posts

Showing posts with the label python-unittest

Decorator works for Function but not Class

Need a bit of help correcting a decorator for unittest. I'm not sure how to meet the requirements of unit test. The idea of this decorator is to mark the test as an expectedFailure IF True is passed in. Otherwise allow the test to simply run. This decorator works for test functions but doesn't work for class definitions The error that I'm getting is test_sometest() takes exactly 1 argument. Removing the decorator allows the test to run. Moving the decorator to top of function allows the test to run. History... One of my platforms works fine and the other platform does not. I want to allow one platform to run all the tests while the other platform will be marked as expected failures. Of course I do not want to use skip or skip if. Since that won't allow the valid platform to run. Marking them as expected failure will also not work since one platform will return unexpected success. With the expectedFailureIf() in place each platform will correctly report and on...