Repository: tumb1er/coverage2clover (language: python)

Issue:
support python-3.11

support python-3.11

support python-3.11



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 9f41f88..6e18d7e 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,7 +11,7 @@ jobs:
     strategy:
       max-parallel: 5
       matrix:
-        python-version: [3.7, 3.8, 3.9, "3.10"]
+        python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
 
     steps:
     - uses: actions/checkout@v2
diff --git a/setup.py b/setup.py
index b59ad52..d808cfa 100644
--- a/setup.py
+++ b/setup.py
@@ -80,6 +80,7 @@ def get_version():
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
         "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
         "Topic :: Text Processing :: Markup :: XML",
         "Topic :: Software Development :: Quality Assurance",
         "Topic :: Software Development :: Testing",
diff --git a/tox.ini b/tox.ini
index bd88c9e..b103c85 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py37, py38, py39, py310
+envlist = py37, py38, py39, py310, py311
 skipsdist = false
 
 [gh-actions]
@@ -8,10 +8,12 @@ python =
   3.8: py38
   3.9: py39
   3.10: py310
+  3.11: py311
 
-[testenv:py{37,38,39,310}]
+[testenv:py{37,38,39,310,311}]
 deps =
   -r requirements.txt
+allowlist_externals = sh
 commands =
   black --check --verbose .
   sh scripts/update_assets.sh


Test patch:
diff --git a/tests.py b/tests.py
index c0a8947..a9b8bae 100644
--- a/tests.py
+++ b/tests.py
@@ -154,9 +154,15 @@ def testWriteClover(self):
             content = tmp.read()
             real = ET.ElementTree(ET.fromstring(content))
             expected = ET.parse(os.path.join(self.assets_dir, "clover.xml"))
-            self.assertEqual(
-                ET.tostring(real.getroot()), ET.tostring(expected.getroot())
-            )
+
+            def normalize(tree):
+                root = tree.getroot()
+                root.attrib = dict(sorted(root.attrib.items()))
+                for element in tree.findall(".//*"):
+                    element.attrib = dict(sorted(element.attrib.items()))
+                return ET.tostring(root)
+
+            self.assertEqual(normalize(real), normalize(expected))
 
 
 if __name__ == "__main__":