From 26158fc3c41b5cd9e5125a68588f9c9b1c1d1cf5 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sun, 2 Feb 2014 18:33:21 +0100 Subject: [PATCH] update test for metaconfig serialization --- test/test_state.py | 5 ++--- tiramisu/config.py | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/test_state.py b/test/test_state.py index e7777f1..fd547ef 100644 --- a/test/test_state.py +++ b/test/test_state.py @@ -5,6 +5,7 @@ from tiramisu.setting import owners from tiramisu.storage import delete_session from tiramisu.error import ConfigError from pickle import dumps, loads +from py.test import raises def return_value(value=None): @@ -288,9 +289,7 @@ def test_state_metaconfig(): conf2._impl_test = True meta = MetaConfig([conf1, conf2], session_id='29090937') meta._impl_test = True - a = dumps(meta) - q = loads(a) - _diff_conf(meta, q) + raises(ConfigError, "dumps(meta)") try: delete_session('29090935') delete_session('29090936') diff --git a/tiramisu/config.py b/tiramisu/config.py index 2c1a6b1..e8fc3ca 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -540,8 +540,6 @@ class _CommonConfig(SubConfig): # ----- state def __getstate__(self): if self._impl_meta is not None: - #FIXME _impl_meta est un weakref => faut pas sauvegarder mais faut bien savoir si c'est un méta ou pas au final ... - #en fait il faut ne pouvoir sérialisé que depuis une MetaConfig ... et pas directement comme pour les options raise ConfigError('cannot serialize Config with MetaConfig') slots = set() for subclass in self.__class__.__mro__: