From ae6bb1bd17d752a537df3dd5fe1ce650d5a3ec06 Mon Sep 17 00:00:00 2001 From: Daniil Fajnberg Date: Fri, 25 Feb 2022 21:17:14 +0100 Subject: [PATCH] skipping unix socket tests on Windows --- .coveragerc | 1 - tests/test_client.py | 4 +++- tests/test_server.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.coveragerc b/.coveragerc index f70c551..d1e79c9 100644 --- a/.coveragerc +++ b/.coveragerc @@ -5,7 +5,6 @@ omit = .venv/* [report] -fail_under = 100 show_missing = True skip_covered = False exclude_lines = diff --git a/tests/test_client.py b/tests/test_client.py index d101f47..4e83770 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -20,10 +20,11 @@ Unittests for the `asyncio_taskpool.client` module. import json +import os import shutil import sys from pathlib import Path -from unittest import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase, skipIf from unittest.mock import AsyncMock, MagicMock, patch from asyncio_taskpool import client @@ -171,6 +172,7 @@ class ControlClientTestCase(IsolatedAsyncioTestCase): self.mock_print.assert_called_once_with("Disconnected from control server.") +@skipIf(os.name == 'nt', "No Unix sockets on Windows :(") class UnixControlClientTestCase(IsolatedAsyncioTestCase): def setUp(self) -> None: diff --git a/tests/test_server.py b/tests/test_server.py index 0d15e0b..c934bc1 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -21,8 +21,9 @@ Unittests for the `asyncio_taskpool.server` module. import asyncio import logging +import os from pathlib import Path -from unittest import IsolatedAsyncioTestCase +from unittest import IsolatedAsyncioTestCase, skipIf from unittest.mock import AsyncMock, MagicMock, patch from asyncio_taskpool import server @@ -119,6 +120,7 @@ class ControlServerTestCase(IsolatedAsyncioTestCase): mock_create_task.assert_called_once_with(mock_awaitable) +@skipIf(os.name == 'nt', "No Unix sockets on Windows :(") class UnixControlServerTestCase(IsolatedAsyncioTestCase): log_lvl: int