Unable to skip test

50 views
Skip to first unread message

sameer....@gmail.com

unread,
Sep 18, 2015, 12:57:27 PM9/18/15
to WTFramework
Note I am using python 2.7
I tried to skip a test in WTF framewwork, it give following error:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.5\helpers\pycharm\utrunner.py", line 151, in
TeamcityTestRunner().run(all, *options)
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.5\helpers\pycharm\tcunittest.py", line 249, in run
test(result)
File "C:\Python27\lib\unittest\suite.py", line 70, in call
return self.run(args, *kwds)
File "C:\Python27\lib\unittest\suite.py", line 108, in run
test(result)
File "C:\Python27\lib\site-packages\unittest2\case.py", line 649, in call
return self.run(args, **kwds)
File "C:\Python27\lib\site-packages\wtframework\wtf\testobjects\testcase.py", line 101, in run

self._addSkip(result, skip_why)
TypeError: _addSkip() takes exactly 4 arguments (3 given)


It seem in WTF framework one cannot skip the test

bsal...@gmail.com

unread,
Oct 3, 2015, 1:39:35 AM10/3/15
to WTFramework
What do u mean by skip .. can u give more details..

sameer....@gmail.com

unread,
Oct 4, 2015, 2:33:47 AM10/4/15
to WTFramework
When I say 'skip', I mean I do not want to run the test (and I do not want to remove the test either) when I am running entire test suite.
In python, it is possible to skip test by doing this: @unittest.skip('Reason'). If one does not use WTF framework, then skip works. But if one wants to skip a test using WTF framework, then it does not work and it give error (error details is in 1st post)

Nick Prescott

unread,
Oct 22, 2015, 9:22:24 AM10/22/15
to WTFramework
I ended up doing the following to be able to skip tests.

Create a skip decorator to raise the SkipTest exception from nose:

import functools
from nose.plugins.skip import SkipTest

def skip(test):

    @functools.wraps(test)
    def wrapper(*args, **kwargs):
        raise SkipTest

    return wrapper

Then, within your test class, apply the decorator:
@skip
def test_foo(self):
....

However, one issue that I have is that this only skips the actual test and not any setup or teardown steps, those will still run.

Hope this helps.

sameer....@gmail.com

unread,
Dec 27, 2015, 5:08:45 PM12/27/15
to WTFramework
Hi Nick,

Thanks for your comment and sorry for extremely late reply. I tried to skip by doing skip decorator, but it give me same error message. In your case does skipping work if you are using wtf framework

Reply all
Reply to author
Forward
0 new messages