Skip to content

Commit

Permalink
Add exception chaining for both py2 and py3 using the six library
Browse files Browse the repository at this point in the history
  • Loading branch information
alysivji committed Jun 4, 2017
1 parent 6a18ace commit 9ab5ab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions engarde/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import six

from engarde import generic
from engarde.generic import verify, verify_all, verify_any
Expand Down Expand Up @@ -265,8 +266,8 @@ def is_same_as(df, df_to_compare, **kwargs):
"""
try:
tm.assert_frame_equal(df, df_to_compare, **kwargs)
except AssertionError as e:
raise AssertionError("DataFrames are not equal")
except AssertionError as exc:
six.raise_from(AssertionError("DataFrames are not equal"), exc)
return df


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

keywords='data analysis',
packages=find_packages(exclude=['tests']),
install_requires=['numpy', 'pandas'],
install_requires=['numpy', 'pandas', 'six'],

# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
Expand Down

0 comments on commit 9ab5ab2

Please sign in to comment.