From 50d437ded75cd2fc6195093b59344d5e0eb16465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 01:05:30 +0200 Subject: [PATCH 1/7] Add a numpy dep for tests --- requirements.dev-2.6.txt | 1 + requirements.dev.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements.dev-2.6.txt b/requirements.dev-2.6.txt index 85b131b..6cb5862 100644 --- a/requirements.dev-2.6.txt +++ b/requirements.dev-2.6.txt @@ -12,3 +12,4 @@ pytest-cov==2.4.0 pytest-mock==1.6.0 six==1.10.0 urwid==1.3.1 +numpy diff --git a/requirements.dev.txt b/requirements.dev.txt index 76d4e01..5a08790 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -8,3 +8,4 @@ pytest-cov==2.4.0 pytest-mock==1.10.0 six==1.10.0 urwid==1.3.1 +numpy \ No newline at end of file -- GitLab From f75ce014996e98cd0ca11c5d7ae961e63d920d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 01:16:39 +0200 Subject: [PATCH 2/7] Py2.6: Use appropriate numpy --- requirements.dev-2.6.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.dev-2.6.txt b/requirements.dev-2.6.txt index 6cb5862..e2534c4 100644 --- a/requirements.dev-2.6.txt +++ b/requirements.dev-2.6.txt @@ -12,4 +12,4 @@ pytest-cov==2.4.0 pytest-mock==1.6.0 six==1.10.0 urwid==1.3.1 -numpy +numpy<1.12 -- GitLab From 2be09e90da04e88629ebc48c0645796965c5cc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 01:17:12 +0200 Subject: [PATCH 3/7] Remove extraneous function call from test_var_view --- test/test_var_view.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/test_var_view.py b/test/test_var_view.py index 8d4f385..5d2bbdb 100644 --- a/test/test_var_view.py +++ b/test/test_var_view.py @@ -26,6 +26,4 @@ def test_get_stringifier(): strifier = get_stringifier(iinfo) s = strifier(value) - assert isinstance(s, text_type) - -test_get_stringifier() + assert isinstance(s, text_type) \ No newline at end of file -- GitLab From 88bd870c8ed65fb56bdfae0be1f69f40861b08c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 23:25:59 +0200 Subject: [PATCH 4/7] Add newline at end of test_var_view.py --- test/test_var_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_var_view.py b/test/test_var_view.py index 5d2bbdb..3f66522 100644 --- a/test/test_var_view.py +++ b/test/test_var_view.py @@ -26,4 +26,4 @@ def test_get_stringifier(): strifier = get_stringifier(iinfo) s = strifier(value) - assert isinstance(s, text_type) \ No newline at end of file + assert isinstance(s, text_type) -- GitLab From 39a5b361571644be99bbad0e02b439a2496f93cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 23:37:51 +0200 Subject: [PATCH 5/7] Make numpy optional in test_var_view.py --- requirements.dev-2.6.txt | 1 - test/test_var_view.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/requirements.dev-2.6.txt b/requirements.dev-2.6.txt index e2534c4..85b131b 100644 --- a/requirements.dev-2.6.txt +++ b/requirements.dev-2.6.txt @@ -12,4 +12,3 @@ pytest-cov==2.4.0 pytest-mock==1.6.0 six==1.10.0 urwid==1.3.1 -numpy<1.12 diff --git a/test/test_var_view.py b/test/test_var_view.py index 3f66522..0bbcb5a 100644 --- a/test/test_var_view.py +++ b/test/test_var_view.py @@ -14,11 +14,17 @@ class A2(object): def test_get_stringifier(): from pudb.var_view import InspectInfo, get_stringifier + try: + import numpy as np + except Import Error: + numpy_values = [] + else: + numpy_values = [np.float32(5), np.zeros(5)] + for value in [ A, A2, A(), A2(), u"lól".encode('utf8'), u"lól", 1233123, [u"lól".encode('utf8'), u"lól"], - np.float32(5), np.zeros(5), - ]: + ] + numpy_values: for display_type in ["type", "repr", "str"]: iinfo = InspectInfo() iinfo.display_type = display_type -- GitLab From 2918c36a033048e68d28fefca77b8636cedeafcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 23:46:00 +0200 Subject: [PATCH 6/7] Fix ImportError typo --- test/test_var_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_var_view.py b/test/test_var_view.py index 0bbcb5a..47d514e 100644 --- a/test/test_var_view.py +++ b/test/test_var_view.py @@ -16,7 +16,7 @@ def test_get_stringifier(): try: import numpy as np - except Import Error: + except ImportError: numpy_values = [] else: numpy_values = [np.float32(5), np.zeros(5)] -- GitLab From cb70fdafff5bed6ccf808b857c86b32d2966d0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Tue, 7 May 2019 23:48:21 +0200 Subject: [PATCH 7/7] Remove redundant top-of-file numpy import --- test/test_var_view.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_var_view.py b/test/test_var_view.py index 47d514e..7294e59 100644 --- a/test/test_var_view.py +++ b/test/test_var_view.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from pudb.py3compat import text_type -import numpy as np class A: -- GitLab