Repository: gridstatus/gridstatus (language: python)

Issue:
Add Code Coverage
Would be nice to generate a codecoverage number like libraries such as https://github.com/alteryx/featuretools

<img width="761" alt="image" src="https://user-images.githubusercontent.com/371792/219980295-f2549c41-1db2-4465-925d-dee3edb903ac.png">

Should to add to both readme and github actions that run on every PR


Discussion / hints:
I can do this 
awesome! is this possible without creating an account somewhere that's not github?

Fix patch:
diff --git a/Makefile b/Makefile
index 37a85d60..a3a25d8e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,13 +6,20 @@ clean:
 	find . -name '*~' -delete
 	find . -name '.coverage.*' -delete
 
+PYTEST_CMD := python -m pytest -s -vv gridstatus/ -n auto
+NOT_SLOW := -m "not slow" --reruns 5 --reruns-delay 3
+
 .PHONY: test
 test:
-	python -m pytest -s -vv gridstatus/ -m "not slow" -n auto  --reruns 5 --reruns-delay 3
+	$(PYTEST_CMD) $(NOT_SLOW)
+
+.PHONY: test-cov
+test-cov:
+	$(PYTEST_CMD) $(NOT_SLOW) --cov=gridstatus --cov-config=./pyproject.toml --cov-report=xml:./coverage.xml
 
 .PHONY: test-slow
 test-slow:
-	python -m pytest -s -vv gridstatus/ -m "slow" -n auto
+	$(PYTEST_CMD) -m "slow"
 
 .PHONY: installdeps-dev
 installdeps-dev:
diff --git a/README.md b/README.md
index fffd1496..3891bea4 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,10 @@
     <a href="https://github.com/kmax12/gridstatus/actions?query=branch%3Amain+workflow%3ATests" target="_blank">
         <img src="https://github.com/kmax12/gridstatus/workflows/Tests/badge.svg?branch=main" alt="Tests" />
     </a>
-    <a href="https://badge.fury.io/py/gridstatus">
+    <a href="https://codecov.io/gh/kmax12/gridstatus" target="_blank">
+        <img src="https://codecov.io/gh/kmax12/gridstatus/branch/main/graph/badge.svg" alt="Code Coverage"//>
+    </a>
+    <a href="https://badge.fury.io/py/gridstatus" target="_blank">
         <img src="https://badge.fury.io/py/gridstatus.svg?maxAge=2592000" alt="PyPI version">
     </a>
 </p>
diff --git a/docs/index.md b/docs/index.md
index 88d7da4b..261914d2 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -19,6 +19,9 @@ kernelspec:
     <a href="https://github.com/kmax12/gridstatus/actions?query=branch%3Amain+workflow%3ATests" target="_blank">
         <img src="https://github.com/kmax12/gridstatus/workflows/Tests/badge.svg?branch=main" alt="Tests" />
     </a>
+    <a href="https://codecov.io/gh/kmax12/gridstatus" target="_blank">
+        <img src="https://codecov.io/gh/kmax12/gridstatus/branch/main/graph/badge.svg" alt="Code Coverage"/>
+    </a>
     <a href="https://badge.fury.io/py/gridstatus" target="_blank">
         <img src="https://badge.fury.io/py/gridstatus.svg?maxAge=2592000" alt="PyPI Version" />
     </a>
diff --git a/pyproject.toml b/pyproject.toml
index bc486a5f..bff89170 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -27,7 +27,7 @@ dependencies = [
     "beautifulsoup4 >= 4.8.13",
     "tabulate >= 0.8.10",
     "tqdm >= 4.64.1",
-    "openpyxl >= 3.0.10",
+    "openpyxl >= 3.1.0",
     "tabula-py >= 2.5.1",
     "lxml >= 4.9.1",
     "plotly >= 5.11.0",
@@ -43,6 +43,7 @@ test = [
     "pytest == 7.1.2",
     "pytest-xdist == 3.0.2",
     "pytest-rerunfailures == 10.3",
+    "pytest-cov == 4.0.0",
 ]
 dev = [
     "ruff == 0.0.202",
@@ -130,3 +131,15 @@ known-first-party = ["gridstatus"]
 
 [tool.ruff.per-file-ignores]
 "__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
+
+[tool.coverage.run]
+source = ["gridstatus"]
+
+[tool.coverage.report]
+exclude_lines =[
+    "pragma: no cover",
+    "def __repr__",
+    "raise AssertionError",
+    "raise NotImplementedError",
+    "if __name__ == .__main__.:",
+]


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 87a29efa..7493222c 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -15,6 +15,18 @@ jobs:
       - name: Install dependencies
         run: |
           python -m pip install ".[test]"
-      - name: Run unit tests
+      - name: Run unit tests without coverage
+        if: ${{ matrix.python-version != '3.11' }}
         run: |
           make test
+      - name: Run unit tests with coverage
+        if: ${{ matrix.python-version == '3.11' }}
+        run: |
+          make test-cov
+      - uses: codecov/codecov-action@v3
+        if: ${{ matrix.python-version == '3.11' }}
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
+          files: ${{ github.workspace }}/coverage.xml
+          fail_ci_if_error: true
+          verbose: true