コード例 #1
0
 def test_configuration_illegal_types(self, key, val):
     """Illegal types for configuration values should raise
     ConfigurationError."""
     c = Configuration()
     with pytest.raises(ConfigurationError):
         c[key] = val
コード例 #2
0
 def test_reconfigure_backend(self):
     """backend option is read only."""
     c = Configuration()
     c.reconfigure(backend='cuda')
     with pytest.raises(ConfigurationError):
         c.reconfigure(backend='other')
コード例 #3
0
ファイル: test_configuration.py プロジェクト: GitPaean/PyOP2
 def test_reconfigure_backend(self):
     """backend option is read only."""
     c = Configuration()
     c.reconfigure(backend='cuda')
     with pytest.raises(ConfigurationError):
         c.reconfigure(backend='other')
コード例 #4
0
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'
コード例 #5
0
ファイル: test_configuration.py プロジェクト: GitPaean/PyOP2
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'