def test_get_num_ctx_switches(self):
        p = psutil.Process(os.getpid())
        before = sum(p.get_num_ctx_switches())
        for x in range(50000):
            after = sum(p.get_num_ctx_switches())
            if after > before:
                return
        self.fail("num ctx switches still the same after 50.000 iterations")
dataset/ETHPy150Open packages/psutil/test/test_psutil.py/TestCase.test_get_num_ctx_switches/original