Test numpy class aliases
+import operator
import os
import shutil
import subprocess
@@ -7,6 +8,7 @@ import unittest
from unittest import mock
import numpy
+import pytest
import cupy
from cupy import testing
@@ -132,6 +134,20 @@ class TestAliases(unittest.TestCase):
assert xp.bitwise_not is xp.invert
+@pytest.mark.parametrize('name', [
+ 'AxisError',
+ 'ComplexWarning',
+ 'ModuleDeprecationWarning',
+ 'RankWarning',
+ 'TooHardError',
+ 'VisibleDeprecationWarning',
+ 'linalg.LinAlgError'
+])
+def test_error_classes(name):
+ get = operator.attrgetter(name)
+ assert get(cupy) is get(numpy)
+
+
# This is copied from chainer/testing/__init__.py, so should be replaced in
# some way.
if __name__ == '__main__':
