Skip to content

Commit

Permalink
Change assertItemsEqual to assertSequenceEqual if Py3
Browse files Browse the repository at this point in the history
Py2 doesn't have the former
  • Loading branch information
jaidevd committed Apr 5, 2016
1 parent e9add28 commit 6c1f022
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions continuous_integration/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ matplotlib
nose
libgfortran
scikit-image
six
8 changes: 7 additions & 1 deletion tftb/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
"""

import unittest
import six
import numpy as np
from tftb import utils


class TestUtils(unittest.TestCase):

@classmethod
def setUpClass(cls):
if six.PY3:
cls.assertItemsEqual = cls.assertSequenceEqual

def test_is_linear(self):
"""Test the is_linear function."""
x = np.arange(10)
Expand All @@ -38,7 +44,7 @@ def test_divider(self):
"""Test the divider function."""
self.assertItemsEqual(utils.divider(4), (2, 2))
self.assertItemsEqual(utils.divider(17), (1, 17))
self.assertItemsEqual(utils.divider(60), (10, 6))
self.assertItemsEqual(utils.divider(60), (6, 10))
x = np.arange(1, 101)
lowers = np.zeros(x.shape)
uppers = np.zeros(x.shape)
Expand Down

0 comments on commit 6c1f022

Please sign in to comment.