Skip to content

Commit ff63fa4

Browse files
committed
Make the tests pass moar on windows?
1 parent a5777f3 commit ff63fa4

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

sasstests.py

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -907,55 +907,55 @@ def __eq__(self, other):
907907
class CustomFunctionsTest(unittest.TestCase):
908908
def test_raises(self):
909909
with assert_raises_compile_error(RegexMatcher(
910-
r'^stdin:1: error in C function raises: \n'
910+
r'^stdin:(0|1): error in C function raises: \n'
911911
r'Traceback \(most recent call last\):\n'
912912
r'.+'
913913
r'AssertionError: foo\n\n'
914914
r'Backtrace:\n'
915-
r'\tstdin:1, in function `raises`\n'
916-
r'\tstdin:1\n$',
915+
r'\tstdin:(0|1), in function `raises`\n'
916+
r'\tstdin:(0|1)\n$',
917917
)):
918918
compile_with_func('a { content: raises(); }')
919919

920920
def test_warning(self):
921-
with assert_raises_compile_error(
922-
'stdin:1: warning in C function returns-warning: '
923-
'This is a warning\n'
924-
'Backtrace:\n'
925-
'\tstdin:1, in function `returns-warning`\n'
926-
'\tstdin:1\n'
927-
):
921+
with assert_raises_compile_error(RegexMatcher(
922+
r'^stdin:(0|1): warning in C function returns-warning: '
923+
r'This is a warning\n'
924+
r'Backtrace:\n'
925+
r'\tstdin:(0|1), in function `returns-warning`\n'
926+
r'\tstdin:(0|1)\n$'
927+
)):
928928
compile_with_func('a { content: returns_warning(); }')
929929

930930
def test_error(self):
931-
with assert_raises_compile_error(
932-
'stdin:1: error in C function returns-error: '
933-
'This is an error\n'
934-
'Backtrace:\n'
935-
'\tstdin:1, in function `returns-error`\n'
936-
'\tstdin:1\n',
937-
):
931+
with assert_raises_compile_error(RegexMatcher(
932+
r'^stdin:(0|1): error in C function returns-error: '
933+
r'This is an error\n'
934+
r'Backtrace:\n'
935+
r'\tstdin:(0|1), in function `returns-error`\n'
936+
r'\tstdin:(0|1)\n$',
937+
)):
938938
compile_with_func('a { content: returns_error(); }')
939939

940940
def test_returns_unknown_object(self):
941-
with assert_raises_compile_error(
942-
'stdin:1: error in C function returns-unknown: '
943-
'Unexpected type: `tuple`.\n'
944-
'Expected one of:\n'
945-
'- None\n'
946-
'- bool\n'
947-
'- str\n'
948-
'- SassNumber\n'
949-
'- SassColor\n'
950-
'- SassList\n'
951-
'- dict\n'
952-
'- SassMap\n'
953-
'- SassWarning\n'
954-
'- SassError\n\n'
955-
'Backtrace:\n'
956-
'\tstdin:1, in function `returns-unknown`\n'
957-
'\tstdin:1\n',
958-
):
941+
with assert_raises_compile_error(RegexMatcher(
942+
r'^stdin:(0|1): error in C function returns-unknown: '
943+
r'Unexpected type: `tuple`.\n'
944+
r'Expected one of:\n'
945+
r'- None\n'
946+
r'- bool\n'
947+
r'- str\n'
948+
r'- SassNumber\n'
949+
r'- SassColor\n'
950+
r'- SassList\n'
951+
r'- dict\n'
952+
r'- SassMap\n'
953+
r'- SassWarning\n'
954+
r'- SassError\n\n'
955+
r'Backtrace:\n'
956+
r'\tstdin:(0|1), in function `returns-unknown`\n'
957+
r'\tstdin:(0|1)\n$',
958+
)):
959959
compile_with_func('a { content: returns_unknown(); }')
960960

961961
def test_none(self):
@@ -1137,3 +1137,7 @@ def test_map_with_map_key(self):
11371137
suite = unittest.TestSuite()
11381138
for test_case in test_cases:
11391139
suite.addTests(loader.loadTestsFromTestCase(test_case))
1140+
1141+
1142+
if __name__ == '__main__':
1143+
unittest.main()

0 commit comments

Comments
 (0)