Update stat, statistics from CPython 3.10.6
@@ -2,9 +2,11 @@ import unittest
import os
import socket
import sys
-from test.support.socket_helper import skip_unless_bind_unix_socket
-from test.support.os_helper import TESTFN
+from test.support import os_helper
+from test.support import socket_helper
from test.support.import_helper import import_fresh_module
+from test.support.os_helper import TESTFN
+
c_stat = import_fresh_module('stat', fresh=['_stat'])
py_stat = import_fresh_module('stat', blocked=['_stat'])
@@ -172,11 +174,16 @@ class TestFilemode:
@unittest.skipUnless(hasattr(os, 'mkfifo'), 'os.mkfifo not available')
def test_fifo(self):
+ if sys.platform == "vxworks":
+ fifo_path = os.path.join("/fifos/", TESTFN)
+ else:
+ fifo_path = TESTFN
+ self.addCleanup(os_helper.unlink, fifo_path)
try:
- os.mkfifo(TESTFN, 0o700)
+ os.mkfifo(fifo_path, 0o700)
except PermissionError as e:
self.skipTest('os.mkfifo(): %s' % e)
- st_mode, modestr = self.get_mode()
+ st_mode, modestr = self.get_mode(fifo_path)
self.assertEqual(modestr, 'prwx------')
self.assertS_IS("FIFO", st_mode)
@@ -194,7 +201,7 @@ class TestFilemode:
self.assertS_IS("BLK", st_mode)
break
- @skip_unless_bind_unix_socket
+ @socket_helper.skip_unless_bind_unix_socket
def test_socket(self):
with socket.socket(socket.AF_UNIX) as s:
s.bind(TESTFN)
