Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit ee86d88

Browse files
committed
Move cleancov in noxfile
Both files are Python so it makes sense to merge them, and it will help with CI configuration.
1 parent 011ca49 commit ee86d88

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

cleancov.py

-12
This file was deleted.

noxfile.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
from xml.etree import ElementTree as ET
12
import os
3+
import re
24
import shutil
5+
import sys
36

47
import nox
58

69

10+
def _clean_coverage(coverage_path):
11+
input_xml = ET.ElementTree(file=coverage_path)
12+
for class_ in input_xml.findall(".//class"):
13+
filename = class_.get("filename")
14+
filename = re.sub("_sync", "_async", filename)
15+
class_.set("filename", filename)
16+
input_xml.write(coverage_path, xml_declaration=True)
17+
18+
719
def tests_impl(session, extras="socks,secure,brotli"):
820
# Install deps and the package itself.
921
session.install("-r", "dev-requirements.txt")
@@ -28,7 +40,7 @@ def tests_impl(session, extras="socks,secure,brotli"):
2840
env={"PYTHONWARNINGS": "always::DeprecationWarning"}
2941
)
3042
session.run("coverage", "xml")
31-
session.run("python", "cleancov.py", "coverage.xml")
43+
_clean_coverage("coverage.xml")
3244

3345

3446
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8", "pypy"])

0 commit comments

Comments
 (0)