Skip to content

Commit

Permalink
Test imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-serdyuk committed Jun 14, 2017
1 parent 6cf057d commit 69a87bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
18 changes: 18 additions & 0 deletions tests/utils/test_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys


def test_no_theano_import():
del sys.modules['theano']
import blocks.utils
assert 'theano' not in sys.modules
from blocks.utils import dict_union
assert 'theano' not in sys.modules
from blocks.utils import check_theano_variable
assert 'theano' in sys.modules


def test_imports():
from blocks.utils import dict_union
from blocks.utils import check_theano_variable
from blocks.utils.utils import dict_union
from blocks.utils.theano_utils import check_theano_variable
7 changes: 0 additions & 7 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,3 @@ def test_find_first_and_second_and_third_level(self):
assert self.mlp.activations[2] in found
assert self.mlp.activations[1].children[0] in found
assert self.mlp.activations[3].children[0].children[0]


def test_imports():
from blocks.utils import dict_union
from blocks.utils import check_theano_variable
from blocks.utils.utils import dict_union
from blocks.utils.theano_utils import check_theano_variable

0 comments on commit 69a87bf

Please sign in to comment.