FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Skip the QE eval-run tests without the qe extra · ymoslem/CRE-Router@51f6717 · GitHub

Commit 51f6717

Browse files
committed
Skip the QE eval-run tests without the qe extra
`datasets` is an optional dependency, so importing it at module scope broke collection on a base install and failed both the tests and release workflows. Guard it with importorskip, and install `datasets` in the tests workflow so the module runs instead of skipping.
1 parent f517a18 commit 51f6717

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
with:
1515
python-version: ${{ matrix.python-version }}
1616
cache: pip
17-
- run: pip install -e . pytest check-manifest
17+
# `datasets` is the one `qe` extra the tests import; without it the QE
18+
# eval-run tests skip instead of running.
19+
- run: pip install -e . pytest check-manifest datasets
1820
- run: pytest -q
1921
# The sdist must contain exactly the tracked tree, no more and no less.
2022
- run: check-manifest

‎tests/test_qe_eval_run.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
into the data; TeleQnA-router ships all five runs with `run` as a column, and
66
before it was restructured the default split selection silently picked a single
77
(cluster, run) slice instead, which is what this filter replaces.
8+
9+
Needs the `qe` extra.
810
"""
911

1012
import pytest
11-
from datasets import Dataset
1213

13-
from cre_router.qe.train import select_eval_run
14+
pytest.importorskip("datasets")
15+
16+
from datasets import Dataset # noqa: E402
17+
18+
from cre_router.qe.train import select_eval_run # noqa: E402
1419

1520

1621
def five_runs(questions=4, runs=5):

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL