bpo-41811: create SortKey members using first given value (GH-22316) (GH-22325)

(cherry picked from commit ae0d2a33ec05aece939a959d36fcf1df1e210a08)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
diff --git a/Lib/test/test_pstats.py b/Lib/test/test_pstats.py
index 10559de..4f78b99 100644
--- a/Lib/test/test_pstats.py
+++ b/Lib/test/test_pstats.py
@@ -95,5 +95,9 @@
         self.assertIn('pass2', funcs_called)
         self.assertIn('pass3', funcs_called)
 
+    def test_SortKey_enum(self):
+        self.assertEqual(SortKey.FILENAME, 'filename')
+        self.assertNotEqual(SortKey.FILENAME, SortKey.CALLS)
+
 if __name__ == "__main__":
     unittest.main()