instead of returning funcarg directlythe parent function returns the results of call to request cached_setup it accepts two arguments for the setup and teardown functions (which we just created)and scope argument this last argument should be one of the three strings "function""module"or "session"it determines just how long the argument will be cached we set it to "sessionin this exampleso it is cached for the duration of the entire py test run the process will not be terminated or restarted until all tests have run the "modulescopeof coursecaches it only for tests in that moduleand the "functionscope treats the object more like normal funcargin that it is reset after each test function is run skipping tests with py test as with the unittest moduleit is frequently necessary to skip tests in py testfor variety of reasonsthe code being tested hasn' been written yetthe test only runs on certain interpreters or operating systemsor the test is time consuming and should only be run under certain circumstances we can skip tests at any point in our code using the py test skip function it accepts single argumenta string describing why it has been skipped this function can be called anywhereif we call it inside test functionthe test will be skipped if we call it at the module levelall the tests in that module will be skipped if we call it inside funcarg functionall tests that call that funcarg will be skipped of coursein all these locationsit is often desirable to skip tests only if certain conditions are or are not met since we can execute the skip function at any place in python codewe can execute it inside an if statement so we may write test that looks like thisimport sys import py test def test_simple_skip()if sys platform !"fakeos"py test skip("test works only on fakeos"fakeos do_something_fake(assert fakeos did_not_happen that' some pretty silly codereally there is no python platform named fakeosso this test will skip on all operating systems it shows how we can skip conditionallyand since the if statement can check any valid conditionalwe have lot of power over when tests are skipped oftenwe check sys version_info to check the python interpreter versionsys platform to check the operating systemor some_library __ version__ to check whether we have recent enough version of given api