Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Cython / tests / run / raise_memory_error_T650.pyx
Size: Mime:
# ticket: 650

cimport cython


@cython.test_assert_path_exists(
    '//RaiseStatNode',
    '//RaiseStatNode[@builtin_exc_name = "MemoryError"]')
def raise_me_type():
    """
    >>> try: raise_me_type()
    ... except MemoryError: pass
    ... else: print('NOT RAISED!')
    """
    raise MemoryError


@cython.test_assert_path_exists(
    '//RaiseStatNode',
    '//RaiseStatNode[@builtin_exc_name = "MemoryError"]')
def raise_me_instance():
    """
    >>> try: raise_me_instance()
    ... except MemoryError: pass
    ... else: print('NOT RAISED!')
    """
    raise MemoryError()


def raise_me_instance_value():
    """
    >>> raise_me_instance_value()
    Traceback (most recent call last):
        ...
    MemoryError: oom
    """
    raise MemoryError("oom")


def raise_me_instance_value_separate():
    """
    >>> raise_me_instance_value_separate()
    Traceback (most recent call last):
        ...
    MemoryError: oom
    """
    raise MemoryError, "oom"