Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Description:
Currently in PTL we don't have any decorator which will skip the testcase irrespective of any condition. We need such decorator, so that without adding any skip code inside the testcase, we can skip the testcase in any condition just by applying it.


Forum: http://community.pbspro.org/t/pp-1278-need-a-skip-decorator-in-ptl-which-will-skip-the-test-without-any-condition/1000


Interface: @skip(reason)
Visibility: Public
Change Control: Stable
Synopsis: New interface to skip the testcase without any skip condition.
Details: This interface will provide user a way to skip a particular testcase with the reason and irrespective of any skip condition.

  • This interface takes one parameter called 'reason'.
  • If '@skip' is applied over a testcase then:
    • Call 'skip()' function defined inside 'utils/pbs_testsuite.py'.
    • Define a wrapper inside 'skip()' which will call 'skipTest()' by passing the 'reason' as an argument to it. 
    • Return the wrapper function.
    • Raise a 'SkipTest' Exception inside 'skipTest()' function with the reason passed and skip the testcase setUp() and execution.
  • Example:

Skip test test_t1:

@skip("Skipping this test due to <issue_id>")
def test_t1:

.

.

Skip the complete testsuite:

@skip("Skipping this testsuite due to <issue_id>")

class SmokeTest():

.

.

  • No labels