https://github.com/inondle/django-template-benchmark
The main thing I want to improve is the way that test cases are run and implemented. To add a test case in this implementation you would have to:
Write a function and decorate it with @cprofile
Create a new elif statement at the bottom and check for a keyword
Run the script with -t <KEYWORD>
While this isn't a terrible work flow it leaves a lot to be desired. I would like to make it more like how the unittest module works with a setup and test method but rather than checking assertions it just profiles the code and prints out a pstats log for each test case. The pstats log can then be rendered further into a call graph or something else.
I've tried to build a profiler class which uses method introspection to run tests but it gets really complicated really fast. I've looked online and can't find a way to subclass or extend the unittest module to do this. Is there a way that I could get the feel of a unittest module but for profiling code instead of running unit tests?
I also need to improve the templates that I run. Right now they are very simple and only render a few lines with a pretty minimal context. If anyone has suggestions on test templates I'm all ears.