Skip to content

Commit

Permalink
Merge 13625c6 into 7054628
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldemarmiesse committed Jul 31, 2019
2 parents 7054628 + 13625c6 commit 8bea828
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_observers/test_sql_observer_not_installed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
from sacred.optional import has_sqlalchemy
from sacred.observers import SqlObserver
from sacred import Experiment


@pytest.fixture
def ex():
return Experiment('ator3000')


@pytest.mark.skipif(has_sqlalchemy, reason='We are testing the import error.')
def test_importerror_sql(ex):
with pytest.raises(ImportError):
ex.observers.append(SqlObserver.create('some_uri'))

@ex.config
def cfg():
a = {'b': 1}

@ex.main
def foo(a):
return a['b']

ex.run()

0 comments on commit 8bea828

Please sign in to comment.