Ejemplo n.º 1
0
    def assertNotEmitted(self, signal):
        """
        .. versionadded:: 1.11

        Make sure the given ``signal`` doesn't get emitted.

        This is intended to be used as a context manager.
        """
        spy = SignalEmittedSpy(signal)
        with spy:
            yield
        spy.assert_not_emitted()
Ejemplo n.º 2
0
    def assertNotEmitted(self, signal):
        """
        .. versionadded:: 1.11

        Make sure the given ``signal`` doesn't get emitted.

        This is intended to be used as a context manager.

        .. note:: This method is also available as ``assert_not_emitted``
                  (pep-8 alias)
        """
        spy = SignalEmittedSpy(signal)
        with spy:
            yield
        spy.assert_not_emitted()
Ejemplo n.º 3
0
    def assertNotEmitted(self, signal):
        """
        .. versionadded:: 1.11

        Make sure the given ``signal`` doesn't get emitted.

        This is intended to be used as a context manager.

        .. note:: This method is also available as ``assert_not_emitted``
                  (pep-8 alias)
        """
        spy = SignalEmittedSpy(signal)
        with spy:
            yield
        spy.assert_not_emitted()
Ejemplo n.º 4
0
    def assertNotEmitted(self, signal, wait=0):
        """
        .. versionadded:: 1.11

        Make sure the given ``signal`` doesn't get emitted.

        :param int wait:
            How many milliseconds to wait to make sure the signal isn't emitted
            asynchronously. By default, this method returns immediately and only
            catches signals emitted inside the ``with``-block.

        This is intended to be used as a context manager.

        .. note:: This method is also available as ``assert_not_emitted``
                  (pep-8 alias)
        """
        spy = SignalEmittedSpy(signal)
        with spy, self.waitSignal(signal, timeout=wait, raising=False):
            yield
        spy.assert_not_emitted()
Ejemplo n.º 5
0
    def assertNotEmitted(self, signal, wait=0):
        """
        .. versionadded:: 1.11

        Make sure the given ``signal`` doesn't get emitted.

        :param int wait:
            How many milliseconds to wait to make sure the signal isn't emitted
            asynchronously. By default, this method returns immediately and only
            catches signals emitted inside the ``with``-block.

        This is intended to be used as a context manager.

        .. note:: This method is also available as ``assert_not_emitted``
                  (pep-8 alias)
        """
        spy = SignalEmittedSpy(signal)
        with spy, self.waitSignal(signal, timeout=wait, raising=False):
            yield
        spy.assert_not_emitted()