From 77e6c5445687485d4e66cb70a6a8fd60b0ba3fa8 Mon Sep 17 00:00:00 2001 From: Xiang Gao Date: Wed, 29 May 2019 11:26:17 -0400 Subject: [PATCH] remove numpy from test --- setup.py | 1 - tests/test_pysnooper.py | 13 ++++++------- tox.ini | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 1186979..e01e6e6 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,6 @@ setuptools.setup( 'tests': { 'pytest', 'python-toolbox', - 'numpy', }, }, classifiers=[ diff --git a/tests/test_pysnooper.py b/tests/test_pysnooper.py index 8ec1037..d7b4140 100644 --- a/tests/test_pysnooper.py +++ b/tests/test_pysnooper.py @@ -6,7 +6,6 @@ import textwrap import threading import types import sys -import numpy from pysnooper.utils import truncate from python_toolbox import sys_tools, temp_file_tools @@ -1141,19 +1140,19 @@ def test_custom_repr(): def print_list_size(l): return 'list(size={})'.format(len(l)) - def print_ndarray(a): - return 'ndarray(shape={}, dtype={})'.format(a.shape, a.dtype) + def print_dict(d): + return 'dict(keys={})'.format(list(d.keys())) def evil_condition(x): - return large(x) or isinstance(x, numpy.ndarray) + return large(x) or isinstance(x, dict) @pysnooper.snoop(string_io, custom_repr=( (large, print_list_size), - (numpy.ndarray, print_ndarray), + (dict, print_dict), (evil_condition, lambda x: 'I am evil'))) def sum_to_x(x): l = list(range(x)) - a = numpy.zeros((10,10)) + a = {'1': 1, '2': 2} return sum(l) result = sum_to_x(10000) @@ -1167,7 +1166,7 @@ def test_custom_repr(): LineEntry(), VariableEntry('l', 'list(size=10000)'), LineEntry(), - VariableEntry('a', 'ndarray(shape=(10, 10), dtype=float64)'), + VariableEntry('a', "dict(keys=['1', '2'])"), LineEntry(), ReturnEntry(), ReturnValueEntry('49995000'), diff --git a/tox.ini b/tox.ini index 2dfc609..94e91ca 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,6 @@ description = Unit tests deps = pytest python_toolbox - numpy commands = pytest setenv = # until python_toolbox is fixed