From 5093d72b9fece1a7c3d7a3d19e4161387ee6475a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 25 Nov 2022 22:50:05 +0000 Subject: Use pytest instead of nose --- tests/html/strip_empty_tests.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'tests/html/strip_empty_tests.py') 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])) -- cgit v1.2.3