(self)
| 213 | "F_SETPIPE_SZ and F_GETPIPE_SZ are not available on all platforms.") |
| 214 | @unittest.skipIf(is_emscripten, "Emscripten pipefs doesn't support these") |
| 215 | def test_fcntl_f_pipesize(self): |
| 216 | test_pipe_r, test_pipe_w = os.pipe() |
| 217 | try: |
| 218 | # Get the default pipesize with F_GETPIPE_SZ |
| 219 | pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ) |
| 220 | pipesize = pipesize_default // 2 # A new value to detect change. |
| 221 | pagesize_default = get_pagesize() |
| 222 | if pipesize < pagesize_default: # the POSIX minimum |
| 223 | raise unittest.SkipTest( |
| 224 | 'default pipesize too small to perform test.') |
| 225 | fcntl.fcntl(test_pipe_w, fcntl.F_SETPIPE_SZ, pipesize) |
| 226 | self.assertEqual(fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ), |
| 227 | pipesize) |
| 228 | finally: |
| 229 | os.close(test_pipe_r) |
| 230 | os.close(test_pipe_w) |
| 231 | |
| 232 | def _check_fcntl_not_mutate_len(self, nbytes=None): |
| 233 | self.f = open(TESTFN, 'wb') |
nothing calls this directly
no test coverage detected