()
| 438 | |
| 439 | |
| 440 | def test_http_client(): |
| 441 | import http.client |
| 442 | |
| 443 | def hook(event, args): |
| 444 | if event.startswith("http.client."): |
| 445 | print(event, *args[1:]) |
| 446 | |
| 447 | sys.addaudithook(hook) |
| 448 | |
| 449 | conn = http.client.HTTPConnection('www.python.org') |
| 450 | try: |
| 451 | conn.request('GET', '/') |
| 452 | except OSError: |
| 453 | print('http.client.send', '[cannot send]') |
| 454 | finally: |
| 455 | conn.close() |
| 456 | |
| 457 | |
| 458 | def test_sqlite3(): |