diff options
| author | Michael Williamson <mike@zwobble.org> | 2022-11-25 22:50:05 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2022-11-25 22:58:16 +0000 |
| commit | 5093d72b9fece1a7c3d7a3d19e4161387ee6475a (patch) | |
| tree | c4122b0f72c7864897d78333e75328ac8c22685b /tests/html/strip_empty_tests.py | |
| parent | 20e3e61530bef546058124c3015ae240733cc974 (diff) | |
Use pytest instead of nose
Diffstat (limited to 'tests/html/strip_empty_tests.py')
| -rw-r--r-- | tests/html/strip_empty_tests.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/tests/html/strip_empty_tests.py b/tests/html/strip_empty_tests.py index b72b50a..8660cff 100644 --- a/tests/html/strip_empty_tests.py +++ b/tests/html/strip_empty_tests.py @@ -1,65 +1,56 @@ -from nose.tools import istest, assert_equal - from mammoth import html +from ..testing import assert_equal -@istest -def text_nodes_with_text_are_not_stripped(): +def test_text_nodes_with_text_are_not_stripped(): assert_equal( [html.text("H")], html.strip_empty([html.text("H")])) -@istest -def empty_text_nodes_are_stripped(): +def test_empty_text_nodes_are_stripped(): assert_equal( [], html.strip_empty([html.text("")])) -@istest -def elements_with_non_empty_children_are_not_stripped(): +def test_elements_with_non_empty_children_are_not_stripped(): assert_equal( [html.element("p", {}, [html.text("H")])], html.strip_empty([html.element("p", {}, [html.text("H")])])) -@istest -def elements_with_no_children_are_stripped(): +def test_elements_with_no_children_are_stripped(): assert_equal( [], html.strip_empty([html.element("p")])) -@istest -def elements_with_only_empty_children_are_stripped(): +def test_elements_with_only_empty_children_are_stripped(): assert_equal( [], html.strip_empty([html.element("p", {}, [html.text("")])])) -@istest -def empty_children_are_removed(): +def test_empty_children_are_removed(): assert_equal( html.strip_empty([html.element("ul", {}, [ html.element("li", {}, [html.text("")]), html.element("li", {}, [html.text("H")]), ])]), - + [html.element("ul", {}, [ html.element("li", {}, [html.text("H")]) ])]) -@istest -def self_closing_elements_are_never_empty(): +def test_self_closing_elements_are_never_empty(): assert_equal( [html.element("br")], html.strip_empty([html.element("br")])) -@istest -def force_writes_are_never_empty(): +def test_force_writes_are_never_empty(): assert_equal( [html.force_write], html.strip_empty([html.force_write])) |
