1+ from __future__ import annotations
2+
13import base64
24import collections .abc
35import contextlib
46import functools
57import glob
68import io
79import json
8- import os
910import os .path
1011import re
1112import shutil
2122
2223import pysassc
2324import sass
24- from sassutils .builder import Manifest , build_directory
25+ from sassutils .builder import build_directory
26+ from sassutils .builder import Manifest
2527from sassutils .wsgi import SassMiddleware
2628
2729
@@ -424,11 +426,11 @@ def importer_with_srcmap(path):
424426 path ,
425427 'a { color: red; }' ,
426428 json .dumps ({
427- " version" : 3 ,
428- " sources" : [
429- path + " .db" ,
429+ ' version' : 3 ,
430+ ' sources' : [
431+ path + ' .db' ,
430432 ],
431- " mappings" : " ;AAAA,CAAC,CAAC;EAAE,KAAK,EAAE,GAAI,GAAI" ,
433+ ' mappings' : ' ;AAAA,CAAC,CAAC;EAAE,KAAK,EAAE,GAAI,GAAI' ,
432434 }),
433435 ),
434436 )
@@ -448,13 +450,13 @@ def importer(path):
448450
449451 with assert_raises_compile_error (
450452 RegexMatcher (
451- r'^Error: \n'
452- r' Traceback \(most recent call last\):\n'
453- r'.+'
454- r'ValueError: Bad path: hi\n'
455- r' on line 1:9 of stdin\n'
456- r'>> @import "hi";\n'
457- r' --------\^\n' ,
453+ r'^Error: \n'
454+ r' Traceback \(most recent call last\):\n'
455+ r'.+'
456+ r'ValueError: Bad path: hi\n'
457+ r' on line 1:9 of stdin\n'
458+ r'>> @import "hi";\n'
459+ r' --------\^\n' ,
458460 ),
459461 ):
460462 sass .compile (string = '@import "hi";' , importers = ((0 , importer ),))
@@ -465,14 +467,14 @@ def importer(path):
465467
466468 with assert_raises_compile_error (
467469 RegexMatcher (
468- r'^Error: \n'
469- r' Traceback \(most recent call last\):\n'
470- r'.+'
471- r'ValueError: Expected importer result to be a tuple of '
472- r'length \(1, 2, 3\) but got 0: \(\)\n'
473- r' on line 1:9 of stdin\n'
474- r'>> @import "hi";\n'
475- r' --------\^\n' ,
470+ r'^Error: \n'
471+ r' Traceback \(most recent call last\):\n'
472+ r'.+'
473+ r'ValueError: Expected importer result to be a tuple of '
474+ r'length \(1, 2, 3\) but got 0: \(\)\n'
475+ r' on line 1:9 of stdin\n'
476+ r'>> @import "hi";\n'
477+ r' --------\^\n' ,
476478 ),
477479 ):
478480 sass .compile (string = '@import "hi";' , importers = ((0 , importer ),))
@@ -483,14 +485,14 @@ def importer(path):
483485
484486 with assert_raises_compile_error (
485487 RegexMatcher (
486- r'^Error: \n'
487- r' Traceback \(most recent call last\):\n'
488- r'.+'
489- r'ValueError: Expected importer result to be a tuple of '
490- r"length \(1, 2, 3\) but got 4: \('a', 'b', 'c', 'd'\)\n"
491- r' on line 1:9 of stdin\n'
492- r'>> @import "hi";\n'
493- r' --------\^\n' ,
488+ r'^Error: \n'
489+ r' Traceback \(most recent call last\):\n'
490+ r'.+'
491+ r'ValueError: Expected importer result to be a tuple of '
492+ r"length \(1, 2, 3\) but got 4: \('a', 'b', 'c', 'd'\)\n"
493+ r' on line 1:9 of stdin\n'
494+ r'>> @import "hi";\n'
495+ r' --------\^\n' ,
494496 ),
495497 ):
496498 sass .compile (string = '@import "hi";' , importers = ((0 , importer ),))
@@ -1116,7 +1118,7 @@ def test_error(self):
11161118class SassFunctionTest (unittest .TestCase ):
11171119
11181120 def test_from_lambda (self ):
1119- lambda_ = lambda abc , d : None # pragma: no branch # noqa: E731
1121+ def lambda_ ( abc , d ): return None # pragma: no branch # noqa: E731
11201122 sf = sass .SassFunction .from_lambda ('func_name' , lambda_ )
11211123 assert 'func_name' == sf .name
11221124 assert ('$abc' , '$d' ) == sf .arguments
@@ -1378,14 +1380,14 @@ class CustomFunctionsTest(unittest.TestCase):
13781380 def test_raises (self ):
13791381 with assert_raises_compile_error (
13801382 RegexMatcher (
1381- r'^Error: error in C function raises: \n'
1382- r' Traceback \(most recent call last\):\n'
1383- r'.+'
1384- r'AssertionError: foo\n'
1385- r' on line 1:14 of stdin, in function `raises`\n'
1386- r' from line 1:14 of stdin\n'
1387- r'>> a { content: raises\(\); }\n'
1388- r' -------------\^\n$' ,
1383+ r'^Error: error in C function raises: \n'
1384+ r' Traceback \(most recent call last\):\n'
1385+ r'.+'
1386+ r'AssertionError: foo\n'
1387+ r' on line 1:14 of stdin, in function `raises`\n'
1388+ r' from line 1:14 of stdin\n'
1389+ r'>> a { content: raises\(\); }\n'
1390+ r' -------------\^\n$' ,
13891391 ),
13901392 ):
13911393 compile_with_func ('a { content: raises(); }' )
0 commit comments