Skip to content

Commit 8579372

Browse files
committed
FIX skip simple test on windows
1 parent 6bb48f7 commit 8579372

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/test_resource_tracker.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ def _resource_unlink(name, rtype):
2525

2626
def get_rtracker_fd():
2727
resource_tracker.ensure_running()
28-
fd = resource_tracker._resource_tracker._fd
29-
if sys.platform == "win32":
30-
import msvcrt
31-
32-
fd = msvcrt.get_osfhandle(fd)
33-
return fd
28+
return resource_tracker._resource_tracker._fd
3429

3530

3631
class TestResourceTracker:
@@ -45,12 +40,15 @@ def test_resource_utils(self, rtype):
4540
assert not resource_exists(name, rtype)
4641

4742
def test_child_retrieves_resource_tracker(self):
48-
parent_rtracker_fd = get_rtracker_fd()
49-
executor = ProcessPoolExecutor(max_workers=2)
50-
child_rtracker_fd = executor.submit(get_rtracker_fd).result()
5143

5244
# First simple fd retrieval check (see #200)
53-
assert child_rtracker_fd == parent_rtracker_fd
45+
# checking fd only work on posix for now
46+
if sys.platform != "win32":
47+
parent_rtracker_fd = get_rtracker_fd()
48+
executor = ProcessPoolExecutor(max_workers=2)
49+
child_rtracker_fd = executor.submit(get_rtracker_fd).result()
50+
51+
assert child_rtracker_fd == parent_rtracker_fd
5452

5553
# Register a resource in the parent process, and un-register it in the
5654
# child process. If the two processes do not share the same

0 commit comments

Comments
 (0)