1+ import importlib .util
2+ import os
13from pathlib import Path
24
35import pytest
@@ -145,12 +147,12 @@ def test_compile_stylesheets(tmp_path: Path, mocker):
145147
146148
147149def 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 () == (
0 commit comments