diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1fed4b0..0c3d1af 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,15 +1,15 @@
repos:
- repo: https://github.com/psf/black
- rev: 20.8b1
+ rev: 25.1.0
hooks:
- id: black
args: [--line-length=80]
- repo: https://github.com/PyCQA/flake8
- rev: "3.8.4"
+ rev: "7.2.0"
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
- rev: v2.7.4
+ rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py36-plus]
diff --git a/morepath_wiki/html.py b/morepath_wiki/html.py
index efb04ee..eceee26 100644
--- a/morepath_wiki/html.py
+++ b/morepath_wiki/html.py
@@ -346,7 +346,7 @@ def __exit__(self, exc_type, exc_value, exc_tb):
self._stack.pop()
def __repr__(self):
- return "".format(self._name, id(self))
+ return f""
def _stringify(self, str_type):
# turn me and my content into text
@@ -424,19 +424,19 @@ def _stringify(self, str_type):
class TestCase(unittest.TestCase):
def test_empty_tag(self):
"generation of an empty HTML tag"
- self.assertEquals(str(HTML().br), "
")
+ self.assertEqual(str(HTML().br), "
")
def test_empty_tag_xml(self):
"generation of an empty XHTML tag"
- self.assertEquals(str(XHTML().br), "
")
+ self.assertEqual(str(XHTML().br), "
")
def test_tag_add(self):
"test top-level tag creation"
- self.assertEquals(str(HTML("html", "text")), "\ntext\n")
+ self.assertEqual(str(HTML("html", "text")), "\ntext\n")
def test_tag_add_no_newline(self):
"test top-level tag creation"
- self.assertEquals(
+ self.assertEqual(
str(HTML("html", "text", newlines=False)), "text"
)
@@ -445,7 +445,7 @@ def test_iadd_tag(self):
h = XML("xml")
h += XML("some-tag", "spam", newlines=False)
h += XML("text", "spam", newlines=False)
- self.assertEquals(
+ self.assertEqual(
str(h),
"
hello
") + self.assertEqual(str(h), "hello
") def test_escape(self): "escaping of special HTML characters in text" h = HTML() h.text("<>&") - self.assertEquals(str(h), "<>&") + self.assertEqual(str(h), "<>&") def test_no_escape(self): "no escaping of special HTML characters in text" h = HTML() h.text("<>&", False) - self.assertEquals(str(h), "<>&") + self.assertEqual(str(h), "<>&") def test_escape_attr(self): "escaping of special HTML characters in attributes" h = HTML() h.br(id='<>&"') - self.assertEquals(str(h), 'hello, world!\nmore text
") + self.assertEqual(str(h), "hello, world!\nmore text
") def test_add_text_newlines(self): "add text to a tag with newlines for prettiness" h = HTML() p = h.p("hello, world!", newlines=True) p.text("more text") - self.assertEquals(str(h), "\nhello, world!\nmore text\n
") + self.assertEqual(str(h), "\nhello, world!\nmore text\n
") def test_doc_newlines(self): "default document adding newlines between tags" h = HTML() h.br h.br - self.assertEquals(str(h), "%s
" % TEST) + self.assertEqual(unicode(h), "%s
" % TEST) def test_table(self): 'multiple "with" context blocks' @@ -598,7 +598,7 @@ def test_table(self): with h.tr: h.td("column 1") h.td("column 2") - self.assertEquals( + self.assertEqual( str(h), """column 1 | column 2 |