Skip to content

Commit 4529f7c

Browse files
authored
add libsass to the dev deps (#4982)
* add libsass to the dev deps * fix test compiler * do b and a * skip tests on windows
1 parent 1ee368d commit 4529f7c

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ dev = [
158158
"pytest-playwright >=0.5.1",
159159
"pytest-retry >=1.7.0,<2.0",
160160
"pytest-split >=0.10.0,<1.0",
161+
"libsass >=0.23.0,<1.0",
161162
"ruff ==0.9.10",
162163
"selenium >=4.11.0,<5.0",
163164
"toml >=0.10.2,<1.0",

tests/units/compiler/test_compiler.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import importlib.util
2+
import os
13
from pathlib import Path
24

35
import pytest
@@ -145,12 +147,12 @@ def test_compile_stylesheets(tmp_path: Path, mocker):
145147

146148

147149
def test_compile_stylesheets_scss_sass(tmp_path: Path, mocker):
148-
try:
149-
import sass # noqa: F401
150-
except ImportError:
150+
if importlib.util.find_spec("sass") is None:
151151
pytest.skip(
152152
'The `libsass` package is required to compile sass/scss stylesheet files. Run `pip install "libsass>=0.23.0"`.'
153153
)
154+
if os.name == "nt":
155+
pytest.skip("Skipping test on Windows")
154156

155157
project = tmp_path / "test_project"
156158
project.mkdir()
@@ -182,8 +184,8 @@ def test_compile_stylesheets_scss_sass(tmp_path: Path, mocker):
182184
str(Path(".web") / "styles" / "styles.css"),
183185
"@import url('./tailwind.css'); \n"
184186
"@import url('./styles.css'); \n"
185-
"@import url('./preprocess/styles_a.css'); \n"
186-
"@import url('./preprocess/styles_b.css'); \n",
187+
f"@import url('./{Path('preprocess') / Path('styles_a.css')!s}'); \n"
188+
f"@import url('./{Path('preprocess') / Path('styles_b.css')!s}'); \n",
187189
)
188190

189191
stylesheets = [
@@ -195,8 +197,8 @@ def test_compile_stylesheets_scss_sass(tmp_path: Path, mocker):
195197
str(Path(".web") / "styles" / "styles.css"),
196198
"@import url('./tailwind.css'); \n"
197199
"@import url('./styles.css'); \n"
198-
"@import url('./preprocess/styles_b.css'); \n"
199-
"@import url('./preprocess/styles_a.css'); \n",
200+
f"@import url('./{Path('preprocess') / Path('styles_b.css')!s}'); \n"
201+
f"@import url('./{Path('preprocess') / Path('styles_a.css')!s}'); \n",
200202
)
201203

202204
assert (project / ".web" / "styles" / "styles.css").read_text() == (

uv.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)