Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit becb1f1

Browse files
committed
cleanup tests, update docstring
1 parent 64dba5f commit becb1f1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

sass.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,10 @@ def compile(**kwargs):
292292
:type custom_functions: :class:`set`,
293293
:class:`collections.abc.Sequence`,
294294
:class:`collections.abc.Mapping`
295+
:param custom_import_extensions: optional extra file extensions which
296+
allow can be imported, eg. ``'.css'``
297+
:type custom_import_extensions: :class:`list`, :class:`str`,
298+
:class:`tuple`
295299
:param indented: optional declaration that the string is Sass, not SCSS
296300
formatted. :const:`False` by default
297301
:type indented: :class:`bool`
@@ -332,6 +336,10 @@ def compile(**kwargs):
332336
:type custom_functions: :class:`set`,
333337
:class:`collections.abc.Sequence`,
334338
:class:`collections.abc.Mapping`
339+
:param custom_import_extensions: optional extra file extensions which
340+
allow can be imported, eg. ``'.css'``
341+
:type custom_import_extensions: :class:`list`, :class:`str`,
342+
:class:`tuple`
335343
:param importers: optional callback functions.
336344
see also below `importer callbacks
337345
<importer-callbacks_>`_ description
@@ -374,6 +382,10 @@ def compile(**kwargs):
374382
:type custom_functions: :class:`set`,
375383
:class:`collections.abc.Sequence`,
376384
:class:`collections.abc.Mapping`
385+
:param custom_import_extensions: optional extra file extensions which
386+
allow can be imported, eg. ``'.css'``
387+
:type custom_import_extensions: :class:`list`, :class:`str`,
388+
:class:`tuple`
377389
:raises sass.CompileError: when it fails for any reason
378390
(for example the given Sass has broken syntax)
379391

sasstests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,14 @@ def test_imports_from_cwd(tmpdir):
14111411
assert out == ''
14121412

14131413

1414+
def test_import_no_css(tmpdir):
1415+
tmpdir.join('other.css').write('body {colour: green}')
1416+
main_scss = tmpdir.join('main.scss')
1417+
main_scss.write("@import 'other';")
1418+
with pytest.raises(sass.CompileError):
1419+
sass.compile(filename=main_scss.strpath)
1420+
1421+
14141422
@pytest.mark.parametrize('exts', [
14151423
'.css',
14161424
('.css',),

0 commit comments

Comments
 (0)