Skip to content

Commit 008dfe2

Browse files
fix test setup issue with setting enable_python_native_blobs
1 parent de192b5 commit 008dfe2

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

tests/test_fetch_same.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
from nose.tools import assert_true, assert_false, assert_equal, \
2-
assert_list_equal, raises
1+
from nose.tools import assert_equal
32
from . import PREFIX, CONN_INFO
43
import numpy as np
54
import importlib
65
try:
76
dj = importlib.import_module('datajoint-python.datajoint', None)
8-
except:
7+
except Exception as e:
98
import datajoint as dj
109

1110
schema = dj.Schema(PREFIX + '_fetch_same', connection=dj.conn(**CONN_INFO))
@@ -22,13 +21,15 @@ class ProjData(dj.Manual):
2221
blah : varchar(10)
2322
"""
2423

25-
ProjData().insert([
26-
{'id': 0, 'resp': 20.33, 'sim': 45.324, 'big': 3, 'blah': 'yes'},
27-
{'id': 1, 'resp': 94.3, 'sim': 34.23,
28-
'big': {'key1': np.random.randn(20, 10)}, 'blah': 'si'},
29-
{'id': 2, 'resp': 1.90, 'sim': 10.23,
30-
'big': np.random.randn(4, 2), 'blah': 'sim'}
31-
])
24+
25+
with dj.config(enable_python_native_blobs=True):
26+
ProjData().insert([
27+
{'id': 0, 'resp': 20.33, 'sim': 45.324, 'big': 3, 'blah': 'yes'},
28+
{'id': 1, 'resp': 94.3, 'sim': 34.23,
29+
'big': {'key1': np.random.randn(20, 10)}, 'blah': 'si'},
30+
{'id': 2, 'resp': 1.90, 'sim': 10.23,
31+
'big': np.random.randn(4, 2), 'blah': 'sim'}
32+
])
3233

3334

3435
class TestFetchSame:

tests/test_jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_sigterm():
8989

9090

9191
def test_suppress_dj_errors():
92-
""" test_suppress_dj_errors: dj errors suppressable w/o native py blobs """
92+
""" test_suppress_dj_errors: dj errors suppressible w/o native py blobs """
9393
schema.schema.jobs.delete()
9494
with dj.config(enable_python_native_blobs=False):
9595
schema.ErrorClass.populate(reserve_jobs=True, suppress_errors=True)

0 commit comments

Comments
 (0)