Skip to content

Commit 601b051

Browse files
committed
Fix test for sdist
1 parent 57d9f30 commit 601b051

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

ci/azure_template_posix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
XARRAY: 2022.6.0
3535
XXHASH: true
3636
FORMULAIC: 1.0.2
37-
test.wheel: true
37+
test.sdist: true
3838
python310_recent:
3939
python.version: '3.10'
4040
NUMPY: 1.24.0

linearmodels/tests/test_examples.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,21 @@
4747
nbs = sorted(glob.glob(os.path.join(NOTEBOOK_DIR, "*.ipynb")))
4848
ids = [os.path.split(nb)[-1].split(".")[0] for nb in nbs]
4949
if not nbs: # pragma: no cover
50+
@pytest.fixture(params=nbs, ids=ids)
51+
def notebook(request):
52+
return request.param
53+
54+
@pytest.mark.slow
55+
@pytest.mark.example
56+
@pytest.mark.skipif(SKIP, reason="Required packages not available")
57+
def test_notebook(notebook):
58+
nb_name = os.path.split(notebook)[-1]
59+
if MISSING_XARRAY and nb_name in NOTEBOOKS_USING_XARRAY:
60+
pytest.skip(f"xarray is required to test {notebook}")
61+
62+
nb = nbformat.read(notebook, as_version=4)
63+
ep = ExecutePreprocessor(allow_errors=False, timeout=120, kernel_name=kernel_name)
64+
ep.preprocess(nb, {"metadata": {"path": NOTEBOOK_DIR}})
65+
66+
else:
5067
pytest.mark.skip(reason="No notebooks found so not tests run")
51-
52-
53-
@pytest.fixture(params=nbs, ids=ids)
54-
def notebook(request):
55-
return request.param
56-
57-
58-
@pytest.mark.slow
59-
@pytest.mark.example
60-
@pytest.mark.skipif(SKIP, reason="Required packages not available")
61-
def test_notebook(notebook):
62-
nb_name = os.path.split(notebook)[-1]
63-
if MISSING_XARRAY and nb_name in NOTEBOOKS_USING_XARRAY:
64-
pytest.skip(f"xarray is required to test {notebook}")
65-
66-
nb = nbformat.read(notebook, as_version=4)
67-
ep = ExecutePreprocessor(allow_errors=False, timeout=120, kernel_name=kernel_name)
68-
ep.preprocess(nb, {"metadata": {"path": NOTEBOOK_DIR}})

0 commit comments

Comments
 (0)