def test_warn_error_for_type(): f = HTMLFormatter() f.for_type(int, lambda i: name_error) with capture_output() as captured: result = f(5) nt.assert_is(result, None) nt.assert_in("Traceback", captured.stdout) nt.assert_in("NameError", captured.stdout) nt.assert_in("name_error", captured.stdout)
def test_warn_error_for_type(): f = HTMLFormatter() f.for_type(int, lambda i: name_error) with capture_output() as captured: result = f(5) nt.assert_is(result, None) nt.assert_in("FormatterWarning", captured.stderr) nt.assert_in("text/html", captured.stderr) nt.assert_in("name_error", captured.stderr)
def test_warn_error_for_type(): f = HTMLFormatter() f.for_type(int, lambda i: name_error) with capture_output() as captured: result = f(5) assert result is None assert "Traceback" in captured.stdout assert "NameError" in captured.stdout assert "name_error" in captured.stdout
def test_warn_error_for_type(): f = HTMLFormatter() f.for_type(int, lambda i: name_error) with capture_output() as captured: result = f(5) nt.assert_is(result, None) nt.assert_in("WARNING", captured.stderr) nt.assert_in("text/html", captured.stderr) nt.assert_in("name_error", captured.stderr)