Skip to content

Commit

Permalink
Skip reload tests on windows and mac
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Dec 14, 2024
1 parent 8bee6d3 commit aa994a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ disallow_untyped_defs = false
check_untyped_defs = true

[tool.pytest.ini_options]
addopts = "-rxXs --strict-config --strict-markers -n 8 --dist loadgroup"
addopts = "-rxXs --strict-config --strict-markers -n 8"
xfail_strict = true
filterwarnings = [
"error",
Expand Down
2 changes: 0 additions & 2 deletions tests/supervisors/test_multiprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from uvicorn.supervisors import Multiprocess
from uvicorn.supervisors.multiprocess import Process

pytestmark = pytest.mark.xdist_group(name="multiprocess")


def new_console_in_windows(test_function: Callable[[], Any]) -> Callable[[], Any]: # pragma: no cover
if os.name != "nt":
Expand Down
18 changes: 8 additions & 10 deletions tests/supervisors/test_reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@
except ImportError: # pragma: no cover
WatchFilesReload = None # type: ignore[misc,assignment]

pytestmark = pytest.mark.xdist_group(name="reloader")

# TODO: Investigate why this is flaky on MacOS M1.
skip_if_m1 = pytest.mark.skipif(
sys.platform == "darwin" and platform.processor() == "arm",
reason="Flaky on MacOS M1",
# TODO: Investigate why this is flaky on MacOS M1, and Windows.
pytestmark = pytest.mark.skipif(
(sys.platform == "darwin" and platform.processor() == "arm") or sys.platform == "win32",
reason="Flaky on MacOS M1, and Windows",
)


Expand Down Expand Up @@ -153,7 +151,7 @@ def test_reload_when_pattern_matched_file_is_changed(self, result: bool, touch_s

reloader.shutdown()

@pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload, marks=skip_if_m1)])
@pytest.mark.parametrize("reloader_class", [WatchFilesReload])
def test_should_not_reload_when_exclude_pattern_match_file_is_changed(
self, touch_soon: Callable[[Path], None]
): # pragma: py-darwin
Expand Down Expand Up @@ -210,7 +208,7 @@ def test_should_reload_when_directories_have_same_prefix(self, touch_soon: Calla

@pytest.mark.parametrize(
"reloader_class",
[StatReload, pytest.param(WatchFilesReload, marks=skip_if_m1)],
[StatReload, pytest.param(WatchFilesReload)],
)
def test_should_not_reload_when_only_subdirectory_is_watched(self, touch_soon: Callable[[Path], None]):
app_dir = self.reload_path / "app"
Expand All @@ -229,7 +227,7 @@ def test_should_not_reload_when_only_subdirectory_is_watched(self, touch_soon: C

reloader.shutdown()

@pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload, marks=skip_if_m1)])
@pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload)])
def test_override_defaults(self, touch_soon: Callable[[Path], None]) -> None: # pragma: py-darwin
dotted_file = self.reload_path / ".dotted"
dotted_dir_file = self.reload_path / ".dotted_dir" / "file.txt"
Expand All @@ -251,7 +249,7 @@ def test_override_defaults(self, touch_soon: Callable[[Path], None]) -> None: #

reloader.shutdown()

@pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload, marks=skip_if_m1)])
@pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload)])
def test_explicit_paths(self, touch_soon: Callable[[Path], None]) -> None: # pragma: py-darwin
dotted_file = self.reload_path / ".dotted"
non_dotted_file = self.reload_path / "ext" / "ext.jpg"
Expand Down

0 comments on commit aa994a8

Please sign in to comment.