(self)
| 793 | os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev, |
| 794 | "Requires fdescfs mounted on /dev/fd on FreeBSD") |
| 795 | def test_script_as_dev_fd(self): |
| 796 | # GH-87235: On macOS passing a non-trivial script to /dev/fd/N can cause |
| 797 | # problems because all open /dev/fd/N file descriptors share the same |
| 798 | # offset. |
| 799 | script = 'print("12345678912345678912345")' |
| 800 | with os_helper.temp_dir() as work_dir: |
| 801 | script_name = _make_test_script(work_dir, 'script.py', script) |
| 802 | with open(script_name, "r") as fp: |
| 803 | p = spawn_python(f"/dev/fd/{fp.fileno()}", close_fds=True, pass_fds=(0,1,2,fp.fileno())) |
| 804 | out, err = p.communicate() |
| 805 | self.assertEqual(out, b"12345678912345678912345\n") |
| 806 | |
| 807 | def test_filter_syntax_warnings_by_module(self): |
| 808 | filename = support.findfile('test_import/data/syntax_warnings.py') |
nothing calls this directly
no test coverage detected