Repository: dottxt-ai/outlines (language: python)

Issue:
Fix Coverage
### What behavior of the library made you think about the improvement?

Currently a lot of tests are marked as missing coverage despite tests existing.

Abbreviated form:

```
Name                                           Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------------------
outlines/fsm/fsm.py                               32     32      0      0     0%   1-69
outlines/fsm/parsing.py                          401    401    126      0     0%   1-870
outlines/fsm/yaml_schema.py                      260    260    156      0     0%   1-574
```

Other modules with coverage may be incorrectly under-counted provided these modules have coverage and are counted as 0% covered.

### How would you like it to behave?

Ensure coverage is measured accurately in CI.


Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index ea0ac11c8..99d4f94e1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -147,6 +147,7 @@ omit = [
     "tests/*",
 ]
 branch = true
+relative_files = true
 
 [tool.coverage.report]
 omit = [


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 10879c78f..b76d723f2 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -36,11 +36,13 @@ jobs:
     - name: Run tests
       run: |
         pytest --cov=outlines
+      env:
+        COVERAGE_FILE: .coverage.${{ steps.matrix-id.outputs.id }}
     - name: Upload coverage data
       uses: actions/upload-artifact@v3
       with:
         name: coverage-data
-        path: .coverage*
+        path: .coverage.*
         if-no-files-found: ignore
 
   coverage:
@@ -66,19 +68,14 @@ jobs:
         with:
           name: coverage-data
 
-      - name: Fetch master for coverage diff
+      - name: Fetch main for coverage diff
         run: |
           git fetch --no-tags --prune origin main
 
       - name: Combine coverage & fail if it's <100%.
         run: |
-          # Combine coverage files (not needed now, but maybe later)
-          # python -m coverage combine
-
-          # Produce an html report with absolute coverage information
+          python -m coverage combine
           python -m coverage html --skip-covered --skip-empty
-
-          # Report relative coverage and write to the workflow's summary
           python -m coverage xml
           diff-cover coverage.xml --markdown-report=coverage.md --fail-under=100 || (cat coverage.md >> $GITHUB_STEP_SUMMARY && exit 1)