Skip to content

Commit

Permalink
Travis fix (#49)
Browse files Browse the repository at this point in the history
* bumping pytest and travis python to 3.6.5

* revert pytest version

* fixes #47

* reverting travis to py3.6

* fix to exclude pandas==0.23.*
  • Loading branch information
fdosani committed Sep 26, 2019
1 parent 71fb051 commit fa5dd07
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enum34>=1.1.6;python_version<"3.4"
pandas>=0.19.0
pandas>=0.19.0,!=0.23.*
numpy>=1.11.3
six>=1.10
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CURR_DIR = os.path.abspath(os.path.dirname(__file__))
INSTALL_REQUIRES = [
'enum34>=1.1.6;python_version<"3.4"',
"pandas>=0.19.0",
"pandas>=0.19.0,!=0.23.*",
"numpy>=1.11.3",
"six>=1.10",
]
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enum34>=1.1.6;python_version<"3.4"
pandas>=0.19.0
pandas>=0.19.0,!=0.23.*
numpy>=1.11.3
pytest>=3.0.6
Sphinx>=1.6.2
Expand Down
21 changes: 12 additions & 9 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ def test_mixed_column_with_ignore_spaces_and_case():

def test_compare_df_setter_bad():
df = pd.DataFrame([{"a": 1, "A": 2}, {"a": 2, "A": 2}])
with raises(TypeError, message="df1 must be a pandas DataFrame"):
with raises(TypeError, match="df1 must be a pandas DataFrame"):
compare = datacompy.Compare("a", "a", ["a"])
with raises(ValueError, message="df1 must have all fields from join_columns"):
with raises(ValueError, match="df1 must have all columns from join_columns"):
compare = datacompy.Compare(df, df.copy(), ["b"])
with raises(ValueError, message="df1 must have unique column names"):
with raises(ValueError, match="df1 must have unique column names"):
compare = datacompy.Compare(df, df.copy(), ["a"])
df_dupe = pd.DataFrame([{"a": 1, "b": 2}, {"a": 1, "b": 3}])
assert datacompy.Compare(df_dupe, df_dupe.copy(), ["a", "b"]).df1.equals(df_dupe)
Expand Down Expand Up @@ -427,15 +427,15 @@ def test_compare_df_setter_different_cases():

def test_compare_df_setter_bad_index():
df = pd.DataFrame([{"a": 1, "A": 2}, {"a": 2, "A": 2}])
with raises(TypeError, message="df1 must be a pandas DataFrame"):
with raises(TypeError, match="df1 must be a pandas DataFrame"):
compare = datacompy.Compare("a", "a", on_index=True)
with raises(ValueError, message="df1 must have unique column names"):
with raises(ValueError, match="df1 must have unique column names"):
compare = datacompy.Compare(df, df.copy(), on_index=True)


def test_compare_on_index_and_join_columns():
df = pd.DataFrame([{"a": 1, "b": 2}, {"a": 2, "b": 2}])
with raises(Exception, message="Only provide on_index or join_columns"):
with raises(Exception, match="Only provide on_index or join_columns"):
compare = datacompy.Compare(df, df.copy(), on_index=True, join_columns=["a"])


Expand Down Expand Up @@ -528,8 +528,11 @@ def test_string_joiner():
def test_decimal_with_joins():
df1 = pd.DataFrame([{"a": Decimal("1"), "b": 2}, {"a": Decimal("2"), "b": 2}])
df2 = pd.DataFrame([{"a": 1, "b": 2}, {"a": 2, "b": 2}])
with raises(ValueError):
compare = datacompy.Compare(df1, df2, "a")
compare = datacompy.Compare(df1, df2, "a")
assert compare.matches()
assert compare.all_columns_match()
assert compare.all_rows_overlap()
assert compare.intersect_rows_match()


def test_decimal_with_nulls():
Expand Down Expand Up @@ -894,5 +897,5 @@ def test_generate_id_within_group(dataframe, expected):
],
)
def test_generate_id_within_group_valueerror(dataframe, message):
with raises(ValueError, message=message):
with raises(ValueError, match=message):
datacompy.core.generate_id_within_group(dataframe, ["a", "b"])

0 comments on commit fa5dd07

Please sign in to comment.