Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Make monkey-patching properly remove ``select.epoll`` and | ||
``select.kqueue``. Reported by Kirill Smelkov. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Tests for the monkey-patched select module. | ||
from gevent import monkey | ||
monkey.patch_all() | ||
|
||
import select | ||
|
||
import gevent.testing as greentest | ||
|
||
|
||
class TestSelect(greentest.TestCase): | ||
|
||
def _make_test(name, ns): # pylint:disable=no-self-argument | ||
def test(self): | ||
self.assertIs(getattr(select, name, self), self) | ||
self.assertFalse(hasattr(select, name)) | ||
test.__name__ = 'test_' + name + '_removed' | ||
ns[test.__name__] = test | ||
|
||
for name in ( | ||
'epoll', | ||
'kqueue', | ||
'kevent', | ||
'devpoll', | ||
): | ||
_make_test(name, locals()) | ||
|
||
del name | ||
del _make_test | ||
|
||
|
||
if __name__ == '__main__': | ||
greentest.main() |