示例#1
0
 def test_ps(self, getpid, Process):
     prev, debug._process = debug._process, None
     try:
         debug.ps()
         Process.assert_called_with(getpid())
         self.assertIs(debug._process, Process())
     finally:
         debug._process = prev
示例#2
0
 def test_ps(self, getpid, Process):
     prev, debug._process = debug._process, None
     try:
         debug.ps()
         Process.assert_called_with(getpid())
         self.assertIs(debug._process, Process())
     finally:
         debug._process = prev
示例#3
0
def test_ps(patching):
    Process = patching('celery.utils.debug.Process')
    getpid = patching('os.getpid')
    prev, debug._process = debug._process, None
    try:
        debug.ps()
        Process.assert_called_with(getpid())
        assert debug._process is Process()
    finally:
        debug._process = prev
示例#4
0
def test_ps(patching):
    Process = patching('celery.utils.debug.Process')
    getpid = patching('os.getpid')
    prev, debug._process = debug._process, None
    try:
        debug.ps()
        Process.assert_called_with(getpid())
        assert debug._process is Process()
    finally:
        debug._process = prev