Skip to content

Commit 7fb3f43

Browse files
committed
skip fork test in signals if windows
1 parent 4037ba8 commit 7fb3f43

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

tests/test_base.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import fcntl
32
import logging
43
import os
54
import random
@@ -11,6 +10,10 @@
1110
import unittest
1211
import weakref
1312

13+
14+
if sys.platform != "win32":
15+
import fcntl
16+
1417
from unittest import mock
1518
from uvloop._testbase import UVTestCase, AIOTestCase
1619

@@ -833,10 +836,11 @@ def test_loop_call_later_handle_cancelled(self):
833836
self.assertFalse(handle.cancelled())
834837

835838
def test_loop_std_files_cloexec(self):
836-
# See https://github.com/MagicStack/uvloop/issues/40 for details.
837-
for fd in {0, 1, 2}:
838-
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
839-
self.assertFalse(flags & fcntl.FD_CLOEXEC)
839+
if sys.platform != "win32":
840+
# See https://github.com/MagicStack/uvloop/issues/40 for details.
841+
for fd in {0, 1, 2}:
842+
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
843+
self.assertFalse(flags & fcntl.FD_CLOEXEC)
840844

841845
def test_default_exc_handler_broken(self):
842846
logger = logging.getLogger('asyncio')

tests/test_signals.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess
44
import sys
55
import time
6+
import unittest
67

78
from uvloop import _testbase as tb
89

@@ -348,6 +349,9 @@ async def f(): pass
348349
self.loop.run_until_complete(runner())
349350

350351
def test_signals_fork_in_thread(self):
352+
if sys.platform == "win32" and self.NEW_LOOP == "asyncio.new_event_loop()":
353+
raise unittest.SkipTest("no add_signal_handler on asyncio loop on Windows")
354+
351355
# Refs #452, when forked from a thread, the main-thread-only signal
352356
# operations failed thread ID checks because we didn't update
353357
# MAIN_THREAD_ID after fork. It's now a lazy value set when needed and

0 commit comments

Comments
 (0)