Skip to content

Commit

Permalink
Fixes tests to deal with behavior changes in Python and to get around…
Browse files Browse the repository at this point in the history
… issue Fast-Trips#191
  • Loading branch information
pedrocamargo committed Jul 13, 2021
1 parent 02597df commit a356756
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fasttrips/Examples/Springfield/configs/A/config_ft.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ debug_output_columns = True
user_class_function = generic_user_class
pathweights_fixed_width = True
overlap_chunk_size = 50
utils_conversion_factor = 10
utils_conversion_factor = 20
12 changes: 6 additions & 6 deletions tests/test_weight_qualifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_parse_weight_qualifiers_bad_key(sample_dataframe):
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME].str.contains('logistic') , 'weight_name'] = \
sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME].str.replace('logistic', 'logging')

with raises(KeyError, message="Expecting KeyError"):
with raises(KeyError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand All @@ -98,7 +98,7 @@ def test_parse_weight_qualifiers_bad_logrithmic_qualifier(sample_dataframe):
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME] == 'arrive_late_cost_min.logarithmic.log_base' , 'weight_name'] = \
'arrive_late_cost_min.logarithmic.log_base_bad'

with raises(AssertionError, message="Expecting AssertionError"):
with raises(AssertionError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand All @@ -108,7 +108,7 @@ def test_parse_weight_qualifiers_bad_logrithmic_qualifier_value(sample_dataframe
"""
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME] ==
'arrive_late_cost_min.logarithmic.log_base', 'weight_value'] = -1
with raises(AssertionError, message="Expecting AssertionError"):
with raises(AssertionError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand All @@ -119,7 +119,7 @@ def test_parse_weight_qualifiers_bad_logistic_qualifier(sample_dataframe):
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME] == 'depart_early_cost_min.logistic.logistic_max' , 'weight_name'] = \
'depart_early_cost_min.logistic.logistic_max_bad'

with raises(AssertionError, message="Expecting AssertionError"):
with raises(AssertionError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand All @@ -129,7 +129,7 @@ def test_parse_weight_qualifiers_bad_logistic_max_qualifier_value(sample_datafra
"""
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME] ==
'depart_early_cost_min.logistic.logistic_max', 'weight_value'] = -1
with raises(AssertionError, message="Expecting AssertionError"):
with raises(AssertionError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand All @@ -139,7 +139,7 @@ def test_parse_weight_qualifiers_bad_logistic_mid_qualifier_value(sample_datafra
"""
sample_dataframe.loc[sample_dataframe[PathSet.WEIGHTS_COLUMN_WEIGHT_NAME] ==
'depart_early_cost_min.logistic.logistic_mid', 'weight_value'] = -1
with raises(AssertionError, message="Expecting AssertionError"):
with raises(AssertionError):
Assignment.process_weight_qualifiers(sample_dataframe)

@pytest.mark.travis
Expand Down

0 comments on commit a356756

Please sign in to comment.