https://github.com/python/cpython/commit/e56ae817e5f3df37a603251641ada5bf182af152
commit: e56ae817e5f3df37a603251641ada5bf182af152
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-05-15T23:09:36Z
summary:

gh-149879: Fix test_resource on Cygwin (#149903)

Setting RLIMIT_FSIZE or RLIMIT_CPU fails with EINVAL on Cygwin.

files:
M Lib/test/test_resource.py

diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index ba736b0806eb1b..6ea27c463f3148 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -45,8 +45,8 @@ def test_fsize_ismax(self):
         resource.setrlimit(resource.RLIMIT_FSIZE, (max, max))
         resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
 
-    @unittest.skipIf(sys.platform == "vxworks",
-                     "setting RLIMIT_FSIZE is not supported on VxWorks")
+    @unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
+                     f"setting RLIMIT_FSIZE is not supported on 
{sys.platform}")
     @unittest.skipUnless(hasattr(resource, 'RLIMIT_FSIZE'), 'requires 
resource.RLIMIT_FSIZE')
     def test_fsize_enforced(self):
         self.addCleanup(os_helper.unlink, os_helper.TESTFN)
@@ -84,8 +84,8 @@ def test_fsize_too_big(self):
         except (OverflowError, ValueError):
             pass
 
-    @unittest.skipIf(sys.platform == "vxworks",
-                     "setting RLIMIT_FSIZE is not supported on VxWorks")
+    @unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
+                     f"setting RLIMIT_FSIZE is not supported on 
{sys.platform}")
     @unittest.skipUnless(hasattr(resource, 'RLIMIT_FSIZE'), 'requires 
resource.RLIMIT_FSIZE')
     def test_fsize_not_too_big(self):
         (cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
@@ -163,8 +163,8 @@ def test_getrusage(self):
             pass
 
     # Issue 6083: Reference counting bug
-    @unittest.skipIf(sys.platform == "vxworks",
-                     "setting RLIMIT_CPU is not supported on VxWorks")
+    @unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
+                     f"setting RLIMIT_CPU is not supported on {sys.platform}")
     @unittest.skipUnless(hasattr(resource, 'RLIMIT_CPU'), 'requires 
resource.RLIMIT_CPU')
     def test_setrusage_refcount(self):
         limits = resource.getrlimit(resource.RLIMIT_CPU)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to