Corey Morris
commited on
Commit
•
5b83d0b
1
Parent(s):
de65005
Added test to test the specific method that is currently producting an error
Browse files- test_integration.py +14 -11
test_integration.py
CHANGED
@@ -11,18 +11,21 @@ class TestAppFunctions(unittest.TestCase):
|
|
11 |
self.processor = ResultDataProcessor()
|
12 |
self.data = self.processor.data # Assuming this gives you the DataFrame you need
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
# If you wish to add any assertions related to the expected output, add them here
|
26 |
def test_streamlit_app_runs():
|
27 |
# Start the Streamlit app in a subprocess
|
28 |
process = subprocess.Popen(["streamlit", "run", "app.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
11 |
self.processor = ResultDataProcessor()
|
12 |
self.data = self.processor.data # Assuming this gives you the DataFrame you need
|
13 |
|
14 |
+
def test_find_top_differences_table_error(self):
|
15 |
+
# replicating the error before fixing it
|
16 |
+
filtered_data = self.data
|
17 |
+
|
18 |
+
# Get the closest 5 models with unique indices
|
19 |
+
closest_models_diffs = filtered_data['MMLU_average'].sub(filtered_data.loc[selected_model_name, 'MMLU_average']).abs()
|
20 |
+
closest_models = closest_models_diffs.nsmallest(5, keep='first').index.drop_duplicates().tolist()
|
21 |
+
|
22 |
+
|
23 |
+
exclude_columns=['Parameters']
|
24 |
+
# Run the problematic function without catching the TypeError
|
25 |
+
top_differences_table, top_differences_tasks = find_top_differences_table(
|
26 |
+
self.data, selected_model_name, closest_models, exclude_columns
|
27 |
+
)
|
28 |
|
|
|
29 |
def test_streamlit_app_runs():
|
30 |
# Start the Streamlit app in a subprocess
|
31 |
process = subprocess.Popen(["streamlit", "run", "app.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|