Skip to content

Commit

Permalink
fix python 2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Jul 17, 2016
1 parent 020ebb0 commit c0bbabe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mlxtend/preprocessing/tests/test_copy_transformer.py
Expand Up @@ -14,6 +14,7 @@
from sklearn.feature_extraction.text import TfidfTransformer
from scipy.sparse import issparse
from mlxtend.utils import assert_raises
import sys


iris = load_iris()
Expand All @@ -27,9 +28,13 @@ def test_copy():

def test_copy_failtype():
copy = CopyTransformer()

expect = ("X must be a list or NumPy array or SciPy sparse array."
" Found <class 'int'>")
if sys.version_info < (3, 0):
expect = expect.replace('class', 'type')
assert_raises(ValueError,
"X must be a list or NumPy array or SciPy sparse array."
" Found <class 'int'>",
expect,
copy.transform,
1)

Expand Down

0 comments on commit c0bbabe

Please sign in to comment.