Skip to content

Commit b237fda

Browse files
authored
Reenable funsor tests (#20)
* Reenable funsor tests * Revert changes to setup.py * Configure funsor backend for torch
1 parent 0ec96c1 commit b237fda

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

test/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
import pytest
55

66

7+
def pytest_configure(config):
8+
try:
9+
import funsor
10+
except ImportError:
11+
pass
12+
else:
13+
funsor.set_backend("torch")
14+
15+
716
def pytest_runtest_call(item):
817
try:
918
item.runtest()

test/test_dispatch.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@ def test_not_implemented(backend):
3939

4040

4141
@pytest.mark.parametrize('model', MODELS)
42-
@pytest.mark.parametrize('backend', [
43-
pytest.param("funsor", marks=[pytest.mark.xfail(
44-
reason="temporarily blocked by https://github.com/pyro-ppl/funsor/pull/327")]),
45-
'minipyro',
46-
'numpy',
47-
'pyro',
48-
])
42+
@pytest.mark.parametrize("backend", ["pyro", "minipyro", "numpy", "funsor"])
4943
@pytest.mark.xfail(reason='Not supported by backend.')
5044
def test_model_sample(model, backend):
5145
pytest.importorskip(PACKAGE_NAME[backend])

test/test_tests.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
}
1717

1818

19-
@pytest.fixture(params=[
20-
"pyro",
21-
"minipyro",
22-
"numpy",
23-
pytest.param("funsor", marks=[pytest.mark.xfail(
24-
reason="temporarily blocked by https://github.com/pyro-ppl/funsor/pull/327")]),
25-
])
19+
@pytest.fixture(params=["pyro", "minipyro", "numpy", "funsor"])
2620
def backend(request):
2721
pytest.importorskip(PACKAGE_NAME[request.param])
2822
with pyro_backend(request.param):

0 commit comments

Comments
 (0)