Browse Source

Remove another "no cover"

tags/nilmdb-2.0.0
Jim Paris 2 years ago
parent
commit
6624e8dab6
2 changed files with 9 additions and 1 deletions
  1. +1
    -1
      nilmdb/utils/serializer.py
  2. +8
    -0
      tests/test_serializer.py

+ 1
- 1
nilmdb/utils/serializer.py View File

@@ -118,7 +118,7 @@ def serializer_proxy(obj_or_type):
try:
# Signal thread to exit, but don't wait for it.
self.__call_queue.put((None, None, None, None))
except: # pragma: no cover
except:
pass

return SerializerObjectProxy(obj_or_type)

+ 8
- 0
tests/test_serializer.py View File

@@ -112,3 +112,11 @@ class TestSerializer(Base):
i = sp(ListLike)()
eq_(list(i), [1,2,3,4,5])
eq_(i[3], 3)

def test_del(self):
sp = nilmdb.utils.serializer_proxy
foo = sp(Foo("x"))

# trigger exception in __del__, which should be ignored
foo._SerializerObjectProxy__call_queue = None
del foo

Loading…
Cancel
Save