* Use the same code to profile for test_profile and test_cprofile.
* Convert both to unittest.
* Use the same unit testing code.
* Include the expected output in both test files.
* Make it possible to regenerate the expected output by running
  the file as a script with an '-r' argument.
diff --git a/Misc/NEWS b/Misc/NEWS
index cf07233..7bb43e1 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1287,6 +1287,8 @@
 Tests
 -----
 
+- Refactor test_profile and test_cprofile to use the same code to profile.
+
 - Make test_runpy reentrant by fixing _check_module to clear out any module
   being tested.  Was causing an error by __import__ doing a reload on the
   second run and thus suppressing bytecode recreation.