test to measure color performance

This commit is contained in:
Fabien Benureau 2013-06-13 12:28:59 +02:00
parent f1bf98cd52
commit 840deaccc1
2 changed files with 13 additions and 0 deletions

10
tests/test_color.py Normal file
View File

@ -0,0 +1,10 @@
import testenv
from papers import color
def perf_color():
s = str(range(1000))
for _ in range(5000000):
color.dye(s, color.red)
if __name__ == '__main__':
perf_color()

3
tests/testenv.py Normal file
View File

@ -0,0 +1,3 @@
# Adjusting paths.
import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../..')))