(self, unlink)
| 777 | |
| 778 | @patch('os.unlink') |
| 779 | def test_remove_OSError(self, unlink): |
| 780 | exc = OSError() |
| 781 | exc.errno = errno.EAGAIN |
| 782 | unlink.side_effect = exc |
| 783 | p = Pidfile('/var/pid') |
| 784 | with pytest.raises(OSError): |
| 785 | p.remove() |
| 786 | unlink.assert_called_with(p.path) |
| 787 | |
| 788 | @patch('os.kill') |
| 789 | def test_remove_if_stale_process_alive(self, kill): |