|
16 | 16 | import unittest |
17 | 17 | import warnings |
18 | 18 |
|
| 19 | +import pytest |
19 | 20 | from six import PY3, StringIO, b, string_types, text_type |
20 | 21 | from werkzeug.test import Client |
21 | 22 | from werkzeug.wrappers import Response |
@@ -230,7 +231,7 @@ def test_compile_disallows_arbitrary_arguments(self): |
230 | 231 | {'filename': 'test/a.scss'}, |
231 | 232 | {'dirname': ('test', '/dev/null')}, |
232 | 233 | ): |
233 | | - with assert_raises(TypeError) as excinfo: |
| 234 | + with pytest.raises(TypeError) as excinfo: |
234 | 235 | sass.compile(herp='derp', harp='darp', **args) |
235 | 236 | msg, = excinfo.value.args |
236 | 237 | assert msg == ( |
@@ -1172,22 +1173,9 @@ def compile_with_func(s): |
1172 | 1173 | return result |
1173 | 1174 |
|
1174 | 1175 |
|
1175 | | -@contextlib.contextmanager |
1176 | | -def assert_raises(exctype): |
1177 | | - # I want pytest.raises, this'll have to do for now |
1178 | | - class C: |
1179 | | - pass |
1180 | | - |
1181 | | - try: |
1182 | | - yield C |
1183 | | - assert False, 'Expected to raise!' |
1184 | | - except exctype as e: |
1185 | | - C.value = e |
1186 | | - |
1187 | | - |
1188 | 1176 | @contextlib.contextmanager |
1189 | 1177 | def assert_raises_compile_error(expected): |
1190 | | - with assert_raises(sass.CompileError) as excinfo: |
| 1178 | + with pytest.raises(sass.CompileError) as excinfo: |
1191 | 1179 | yield |
1192 | 1180 | msg, = excinfo.value.args |
1193 | 1181 | assert msg.decode('UTF-8') == expected, (msg, expected) |
@@ -1425,22 +1413,3 @@ def test_map_with_map_key(self): |
1425 | 1413 | ), |
1426 | 1414 | 'a{content:baz}\n', |
1427 | 1415 | ) |
1428 | | - |
1429 | | - |
1430 | | -test_cases = [ |
1431 | | - SassTestCase, |
1432 | | - CompileTestCase, |
1433 | | - BuilderTestCase, |
1434 | | - ManifestTestCase, |
1435 | | - WsgiTestCase, |
1436 | | - DistutilsTestCase, |
1437 | | - SasscTestCase, |
1438 | | - CompileDirectoriesTest, |
1439 | | - SassFunctionTest, |
1440 | | - SassTypesTest, |
1441 | | - CustomFunctionsTest, |
1442 | | -] |
1443 | | -loader = unittest.defaultTestLoader |
1444 | | -suite = unittest.TestSuite() |
1445 | | -for test_case in test_cases: |
1446 | | - suite.addTests(loader.loadTestsFromTestCase(test_case)) |
0 commit comments