test.py: cleanup graph creation