Example #1
0
    def testGetKnownNumberTypes(self):
        import numpy
        import sys

        assert _GetKnownNumberTypes() == (int, float, long, numpy.number)

        numpy_module = sys.modules['numpy']
        try:
            sys.modules['numpy'] = None
            assert _GetKnownNumberTypes() == (int, float, long)
        finally:
            sys.modules['numpy'] = numpy_module
Example #2
0
    def testGetKnownNumberTypes(self):
        import sys
        numpy = pytest.importorskip('numpy')

        assert _GetKnownNumberTypes() == (int, float, long, complex, numpy.number)

        numpy_module = sys.modules['numpy']
        try:
            sys.modules['numpy'] = None
            assert _GetKnownNumberTypes() == (int, float, long, complex)
        finally:
            sys.modules['numpy'] = numpy_module
Example #3
0
    def testGetKnownNumberTypes(self):
        import numpy
        import sys

        assert _GetKnownNumberTypes() == (int, float, long, numpy.number)

        numpy_module = sys.modules['numpy']
        try:
            sys.modules['numpy'] = None
            assert _GetKnownNumberTypes() == (int, float, long)
        finally:
            sys.modules['numpy'] = numpy_module