Skip to content

Commit

Permalink
make sure we always reset backends, even if we don't set them explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Sep 19, 2018
1 parent de46ec7 commit f6a4228
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
import pyhf
import tensorflow as tf

@pytest.fixture(scope='function', autouse=True)
def reset_backend():
yield reset_backend
pyhf.set_backend(pyhf.default_backend)

@pytest.fixture(scope='function', params=[
(pyhf.tensor.numpy_backend(),),
(pyhf.tensor.tensorflow_backend(session=tf.Session()),),
Expand Down Expand Up @@ -50,5 +55,3 @@ def backend(request):
pyhf.tensorlib.session = tf.Session()

yield request.param

pyhf.set_backend(pyhf.default_backend)

0 comments on commit f6a4228

Please sign in to comment.