Skip tests or modules that require working sockets Can be used as a function/class decorator or to skip an entire module.
(*, module=False)
| 646 | ) |
| 647 | |
| 648 | def requires_working_socket(*, module=False): |
| 649 | """Skip tests or modules that require working sockets |
| 650 | |
| 651 | Can be used as a function/class decorator or to skip an entire module. |
| 652 | """ |
| 653 | msg = "requires socket support" |
| 654 | if module: |
| 655 | if not has_socket_support: |
| 656 | raise unittest.SkipTest(msg) |
| 657 | else: |
| 658 | return unittest.skipUnless(has_socket_support, msg) |
| 659 | |
| 660 | |
| 661 | @functools.cache |
no outgoing calls
no test coverage detected
searching dependent graphs…