I have a python program that reads test result information from SQL and creates the following data that I want to capture in a data structure so it can be prioritized appropriately :-
test_name new fail P1 test_name known fail (but no bug logged) P2 test_name known fail (bug logged but is closed) P3 test_name known fail (bug is open) P4 If I run my script I will get one of these types of failures - PLUS the number of occurrences of each type, sample data as follows:- P1 new fail | occurrence once (obviously) P1 new fail | occurrence once (obviously) P1 new fail | occurrence once (obviously) P1 new fail | occurrence once (obviously) P2 known fail | occurred previously 10 times in earlier executions P2 known fail | occurred previously 15 times in earlier executions P2 known fail | occurred previously 16 times in earlier executions P2 known fail | occurred previously 5 times in earlier executions P3 known fail | occurred previously 6 times in earlier executions P4 known fail | occurred previously 1 times in earlier executions P4 known fail | occurred previously 12 times in earlier executions . . . etc I want to be store this in an appropriate structure so I can then so some analysis :- if (all reported fails are "new fail"): this is priority 1 if (some fails are "new fail" and some are known (P2/P3/P4): this is priority 2 if (no new fail, but all/some reported fails are "P2 known fail") this is priority 3 if ( all/some reported fails are "P3 known fail") this is priority 4 if ( all/some reported fails are "P4 known fail") this is priority 4 I have tried using dictionary/lists but can't get the exact final outcome I want, any help appreciated.... -- http://mail.python.org/mailman/listinfo/python-list