File: patcher_builtin.py

package info (click to toggle)
python-eventlet 0.33.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,920 kB
  • sloc: python: 25,863; makefile: 98; sh: 7
file content (14 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
if __name__ == '__main__':
    from tests.mock import patch

    import sys
    import eventlet
    from eventlet import hubs
    with patch.object(hubs, 'notify_opened') as mock_func:
        eventlet.monkey_patch(builtins=True)
        with open(__file__, 'r') as f:
            mock_func.assert_called_with(f.fileno())
        if sys.version_info.major == 2:
            with file(__file__, 'r') as f:
                mock_func.assert_called_with(f.fileno())
    print('pass')