def setUp(self): unittest.TestCase.setUp(self) with patch.object(ProcessCheck, '_detect') as mock_detect: self.proc_plugin = ProcessCheck('temp_dir') self.assertTrue(mock_detect.called)