Skip to content

Commit

Permalink
Merge pull request #39 from alysivji/add-exception-chaining
Browse files Browse the repository at this point in the history
Add exception chaining for both py2 and py3 using the six library
  • Loading branch information
TomAugspurger committed Jun 28, 2017
2 parents 7a96308 + a29b1e9 commit a36c106
Show file tree
Hide file tree
Showing 3 changed files with 5 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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy>=1.8
pandas>=0.16.2
six>=1.10.0
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 a36c106

Please sign in to comment.