def test_enoent_ebadf_on_unregister(self):
        # ENOENT and EBADF are supposed to be ignored
        for errnum in (errno.EBADF, errno.ENOENT):
            with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
                m.return_value.unregister.side_effect = \
                    EnvironmentError(errnum, "")
                s, rd, wr = self.test_register()
                s.unregister(rd)
        # ...but just those
        with mock.patch(self.poller_mock, return_vaue=mock.Mock()) as m:
            m.return_value.unregister.side_effect = \
                EnvironmentError(errno.EEXIST, "")
            s, rd, wr = self.test_register()
            self.assertRaises(EnvironmentError, s.unregister, rd)