Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel committed Feb 6, 2025
1 parent e55a004 commit 64b8af9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def test_append_ndarray_2d(self):

def test_append_ndarray_1d(self):
obj = MyNWBData("obj1", data=np.array([1, 2, 3]))
obj.append([4])
obj.append(4)
np.testing.assert_array_equal(obj.data, [1, 2, 3, 4])

def test_append_scalar(self):
obj = MyNWBData("obj1", data=1)
obj = NWBData("obj1", data=1)
with self.assertRaises(ValueError):
obj.append(2)

Expand All @@ -96,7 +96,7 @@ def test_extend_ndarray_2d(self):
np.testing.assert_array_equal(obj.data, [[1, 2, 3], [1, 2, 3], [4, 5, 6]])

def test_extend_scalar(self):
obj = MyNWBData("obj1", data=1)
obj = NWBData("obj1", data=1)
with self.assertRaises(ValueError):
obj.extend(2)

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_scratch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ def test_constructor_list(self):
self.assertEqual(sd.description, 'test scratch')

def test_notes_deprecation(self):
with self.assertWarnsWith(PendingDeprecationWarning, 'The notes argument is deprecated'):
with self.assertWarnsWith(PendingDeprecationWarning,
'The `notes` argument of ScratchData.__init__ will' \
'be deprecated. Use description instead.'):
ScratchData(name='foo', data=[1, 2, 3, 4], notes='notes')
with self.assertRaises(ValueError):
ScratchData(name='foo', data=[1, 2, 3, 4], description='test scratch', notes='notes')
Expand Down

0 comments on commit 64b8af9

Please sign in to comment.