Skip to content

Commit e56ae81

Browse files
authored
gh-149879: Fix test_resource on Cygwin (#149903)
Setting RLIMIT_FSIZE or RLIMIT_CPU fails with EINVAL on Cygwin.
1 parent 1441f2f commit e56ae81

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Lib/test/test_resource.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def test_fsize_ismax(self):
4545
resource.setrlimit(resource.RLIMIT_FSIZE, (max, max))
4646
resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max))
4747

48-
@unittest.skipIf(sys.platform == "vxworks",
49-
"setting RLIMIT_FSIZE is not supported on VxWorks")
48+
@unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
49+
f"setting RLIMIT_FSIZE is not supported on {sys.platform}")
5050
@unittest.skipUnless(hasattr(resource, 'RLIMIT_FSIZE'), 'requires resource.RLIMIT_FSIZE')
5151
def test_fsize_enforced(self):
5252
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
@@ -84,8 +84,8 @@ def test_fsize_too_big(self):
8484
except (OverflowError, ValueError):
8585
pass
8686

87-
@unittest.skipIf(sys.platform == "vxworks",
88-
"setting RLIMIT_FSIZE is not supported on VxWorks")
87+
@unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
88+
f"setting RLIMIT_FSIZE is not supported on {sys.platform}")
8989
@unittest.skipUnless(hasattr(resource, 'RLIMIT_FSIZE'), 'requires resource.RLIMIT_FSIZE')
9090
def test_fsize_not_too_big(self):
9191
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
@@ -163,8 +163,8 @@ def test_getrusage(self):
163163
pass
164164

165165
# Issue 6083: Reference counting bug
166-
@unittest.skipIf(sys.platform == "vxworks",
167-
"setting RLIMIT_CPU is not supported on VxWorks")
166+
@unittest.skipIf(sys.platform in ("vxworks", "cygwin"),
167+
f"setting RLIMIT_CPU is not supported on {sys.platform}")
168168
@unittest.skipUnless(hasattr(resource, 'RLIMIT_CPU'), 'requires resource.RLIMIT_CPU')
169169
def test_setrusage_refcount(self):
170170
limits = resource.getrlimit(resource.RLIMIT_CPU)

0 commit comments

Comments
 (0)