Skip to content

BUG: #6175 removed assert_ statements #6321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ def setUp(self):

def test_shallow_copying(self):
original = self.container.copy()
assert_isinstance(self.container.view(), FrozenNDArray)
self.assertFalse(isinstance(self.container.view(np.ndarray), FrozenNDArray))
self.assertIsInstance(self.container.view(), FrozenNDArray)
self.assertNotIsInstance(self.container.view(np.ndarray), FrozenNDArray)
self.assertIsNot(self.container.view(), self.container)
self.assert_numpy_array_equal(self.container, original)
# shallow copy should be the same too
assert_isinstance(self.container._shallow_copy(), FrozenNDArray)
self.assertIsInstance(self.container._shallow_copy(), FrozenNDArray)
# setting should not be allowed
def testit(container): container[0] = 16

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_categorical.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=E1101,E1103,W0232
#pylint: disable=E1101,E1103,W0232

from datetime import datetime
from pandas.compat import range, lrange, u
Expand Down
9 changes: 9 additions & 0 deletions pandas/tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pandas.util.testing import (
assert_almost_equal, assertRaisesRegexp, raise_with_traceback, assert_series_equal
)
from pandas.util import testing

# let's get meta.

Expand Down Expand Up @@ -153,3 +154,11 @@ def test_not_equal(self):
# ATM meta data is not checked in assert_series_equal
# self._assert_not_equal(Series(range(3)),Series(range(3),name='foo'),check_names=True)


class TestAssertNumpyArrayEquals(testing.TestCase):

def test_equal(self):
np_array = np.array([1, 2, 3])
equal_array = np.array([1, 2, 3])
self.assert_numpy_array_equal(np_array, equal_array)