Commits

Alessio Deiana committed 6d730c0

fixes some depreciations warnings

Comments (0)

Files changed (3)

circuits/core/components.py

             handlers = [v for k, v in getmembers(self, p)]
             for handler in handlers:
                 target = handler.target or getattr(self, "channel", "*")
-                self.add(handler, target=target)
+                self.addHandler(handler, target=target)
         else:
             for handler in chain(self._globals, self._handlers):
                 kwargs = {}
                     del kwargs["channels"]
                 else:
                     channels = ()
-                manager.add(handler, *channels, **kwargs)
+                manager.addHandler(handler, *channels, **kwargs)
 
     def _unregisterHandlers(self, manager):
         for handler in self._handlers.copy():

circuits/core/manager.py

            Use :py:meth:`addHandler` instead.
         """
 
-        warn(DeprecationWarning("Use .addHandler(...) instead"))
+        warn(DeprecationWarning("Use .addHandler(...) instead"), DeprecationWarning, 2)
 
         return self.addHandler(*args, **kwargs)
 
            Use :py:meth:`fire` instead.
         """
 
-        warn(DeprecationWarning("Use .fire(...) instead"))
+        warn(DeprecationWarning("Use .fire(...) instead"), DeprecationWarning, 2)
 
         return self.fire(*args, **kwargs)
 

tests/core/test_core.py

 while app: app.flush()
 
 def test_fire():
-    x = m.push(Test())
+    x = m.fire(Test())
     m.flush()
     assert x.value == "Hello World!"