提交 325ce519 authored 作者: AdeB's avatar AdeB

modify test config to check that flags are removed

上级 494ff73b
...@@ -3,7 +3,6 @@ Test config options. ...@@ -3,7 +3,6 @@ Test config options.
""" """
import unittest import unittest
from theano import config
from theano.configparser import AddConfigVar, ConfigParam, THEANO_FLAGS_DICT from theano.configparser import AddConfigVar, ConfigParam, THEANO_FLAGS_DICT
...@@ -31,7 +30,6 @@ class T_config(unittest.TestCase): ...@@ -31,7 +30,6 @@ class T_config(unittest.TestCase):
except ValueError: except ValueError:
pass pass
try:
THEANO_FLAGS_DICT['T_config.test_invalid_default_b'] = 'ok' THEANO_FLAGS_DICT['T_config.test_invalid_default_b'] = 'ok'
# This should succeed since we defined a proper value, even # This should succeed since we defined a proper value, even
# though the default was invalid. # though the default was invalid.
...@@ -40,8 +38,8 @@ class T_config(unittest.TestCase): ...@@ -40,8 +38,8 @@ class T_config(unittest.TestCase):
doc='unittest', doc='unittest',
configparam=ConfigParam('invalid', filter=filter), configparam=ConfigParam('invalid', filter=filter),
in_c_key=False) in_c_key=False)
finally:
# Dicionary clean-up. # Check that the flag has been removed
del THEANO_FLAGS_DICT['T_config.test_invalid_default_b'] assert 'T_config.test_invalid_default_b' not in THEANO_FLAGS_DICT
# TODO We should remove these dummy options on test exit. # TODO We should remove these dummy options on test exit.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论