$11 GRAYBYTE WORDPRESS FILE MANAGER $47

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/tests/

HOME
Current File : /opt/alt/python37/lib64/python3.7/site-packages/numpy/lib/tests//test_utils.py
from __future__ import division, absolute_import, print_function

import sys
from numpy.core import arange
from numpy.testing import (
    run_module_suite, assert_, assert_equal, assert_raises_regex, dec
    )
from numpy.lib import deprecate
import numpy.lib.utils as utils

if sys.version_info[0] >= 3:
    from io import StringIO
else:
    from StringIO import StringIO


@dec.skipif(sys.flags.optimize == 2)
def test_lookfor():
    out = StringIO()
    utils.lookfor('eigenvalue', module='numpy', output=out,
                  import_modules=False)
    out = out.getvalue()
    assert_('numpy.linalg.eig' in out)


@deprecate
def old_func(self, x):
    return x


@deprecate(message="Rather use new_func2")
def old_func2(self, x):
    return x


def old_func3(self, x):
    return x
new_func3 = deprecate(old_func3, old_name="old_func3", new_name="new_func3")


def test_deprecate_decorator():
    assert_('deprecated' in old_func.__doc__)


def test_deprecate_decorator_message():
    assert_('Rather use new_func2' in old_func2.__doc__)


def test_deprecate_fn():
    assert_('old_func3' in new_func3.__doc__)
    assert_('new_func3' in new_func3.__doc__)


def test_safe_eval_nameconstant():
    # Test if safe_eval supports Python 3.4 _ast.NameConstant
    utils.safe_eval('None')


def test_byte_bounds():
    a = arange(12).reshape(3, 4)
    low, high = utils.byte_bounds(a)
    assert_equal(high - low, a.size * a.itemsize)


def test_assert_raises_regex_context_manager():
    with assert_raises_regex(ValueError, 'no deprecation warning'):
        raise ValueError('no deprecation warning')


if __name__ == "__main__":
    run_module_suite()

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 3.40 AM
root / root
0755
__pycache__
--
31 Aug 2024 3.40 AM
root / root
0755
data
--
31 Aug 2024 3.40 AM
root / root
0755
test__datasource.py
10.16 KB
25 Apr 2023 2.30 AM
root / root
0644
test__iotools.py
13.149 KB
25 Apr 2023 2.30 AM
root / root
0644
test__version.py
2.075 KB
25 Apr 2023 2.30 AM
root / root
0644
test_arraypad.py
42.677 KB
25 Apr 2023 2.30 AM
root / root
0644
test_arraysetops.py
15.486 KB
25 Apr 2023 2.30 AM
root / root
0644
test_arrayterator.py
1.421 KB
25 Apr 2023 2.30 AM
root / root
0644
test_financial.py
6.62 KB
25 Apr 2023 2.30 AM
root / root
0644
test_format.py
33.491 KB
25 Apr 2023 2.30 AM
root / root
0644
test_function_base.py
126.81 KB
25 Apr 2023 2.30 AM
root / root
0644
test_index_tricks.py
13.098 KB
25 Apr 2023 2.30 AM
root / root
0644
test_io.py
75.595 KB
25 Apr 2023 2.30 AM
root / root
0644
test_mixins.py
6.695 KB
25 Apr 2023 2.30 AM
root / root
0644
test_nanfunctions.py
34.067 KB
25 Apr 2023 2.30 AM
root / root
0644
test_packbits.py
12.626 KB
25 Apr 2023 2.30 AM
root / root
0644
test_polynomial.py
7.027 KB
25 Apr 2023 2.30 AM
root / root
0644
test_recfunctions.py
30.536 KB
25 Apr 2023 2.30 AM
root / root
0644
test_regression.py
8.622 KB
25 Apr 2023 2.30 AM
root / root
0644
test_shape_base.py
19.016 KB
25 Apr 2023 2.30 AM
root / root
0644
test_stride_tricks.py
14.689 KB
25 Apr 2023 2.30 AM
root / root
0644
test_twodim_base.py
16.724 KB
25 Apr 2023 2.30 AM
root / root
0644
test_type_check.py
12.621 KB
25 Apr 2023 2.30 AM
root / root
0644
test_ufunclike.py
2.963 KB
25 Apr 2023 2.30 AM
root / root
0644
test_utils.py
1.617 KB
25 Apr 2023 2.30 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF