Skip to content

Commit

Permalink
cleaner index_keys in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dkaslovsky committed Sep 16, 2018
1 parent 5fc5e67 commit 947f58c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/test_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ class TestObservationCounter(unittest.TestCase):
{'feature_a': 'a_val_1', 'feature_b': 'b_val_1', 'feature_c': 'c_val_1'},
{'feature_b': 'b_val_1', 'feature_c': 'c_val_2', 'feature_a': 'a_val_1'}
]
# cast to list for Python 3
all_index_keys = set(list(observations[0].items()) + list(observations[1].items()))

# keep a set of all feature_name, feature_val pairs for testing
all_index_keys = set()
for observation in observations:
for item in iteritems(observation):
all_index_keys.add(item)

def setUp(self):
self.oc = ObservationCounter()
Expand Down Expand Up @@ -145,8 +149,8 @@ class TestObservationCounterWithMissingData(unittest.TestCase):
{'feature_a': 'a_val_1', 'feature_c': 'c_val_2', 'feature_d': np.nan},
{'feature_b': 'b_val_1', 'feature_a': 'a_val_1', 'feature_c': np.nan}
]
#[obs for obs in observations[0].items() if not isnan(obs[1])]

# keep a set of all feature_name, feature_val pairs for testing
all_index_keys = set()
for observation in observations:
for item in iteritems(observation):
Expand Down

0 comments on commit 947f58c

Please sign in to comment.