Set type names earlier in posixmodule.c (#140168)

This commit is contained in:
Victor Stinner 2025-10-16 12:54:57 +02:00 committed by GitHub
parent 7ac94fcb1d
commit 4641925bf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 10 deletions

View file

@ -164,6 +164,20 @@ def test_getcwdb(self):
self.assertIsInstance(cwd, bytes)
self.assertEqual(os.fsdecode(cwd), os.getcwd())
def test_type_fqdn(self):
def fqdn(obj):
return (obj.__module__, obj.__qualname__)
native = os.name
self.assertEqual(fqdn(os.stat_result), ("os", "stat_result"))
self.assertEqual(fqdn(os.times_result), (native, "times_result"))
if hasattr(os, "statvfs_result"):
self.assertEqual(fqdn(os.statvfs_result), ("os", "statvfs_result"))
if hasattr(os, "sched_param"):
self.assertEqual(fqdn(os.sched_param), (native, "sched_param"))
if hasattr(os, "waitid_result"):
self.assertEqual(fqdn(os.waitid_result), (native, "waitid_result"))
# Tests creating TESTFN
class FileTests(unittest.TestCase):