Browse Source

Keep state with env

pull/219/merge
Florian Mounier 10 years ago
parent
commit
27132c0432
  1. 7
      demo/moulinrouge/tests.py
  2. 4
      pygal/graph/base.py

7
demo/moulinrouge/tests.py

@ -635,4 +635,11 @@ def get_test_routes(app):
graph.add('inverse', [1, 2, 3, 12, 24, 36])
return graph.render_response()
@app.route('/test/only_zeroes')
def test_only_zeroes():
line = Line()
line.add('zeroes', [])
line.add('zeroes 2', [0])
return line.render_response()
return list(sorted(filter(lambda x: x.startswith('test'), locals())))

4
pygal/graph/base.py

@ -35,6 +35,7 @@ from pygal.adapters import (
from functools import reduce
from uuid import uuid4
import io
import os
class BaseGraph(object):
@ -216,6 +217,9 @@ class BaseGraph(object):
self.svg.pre_render()
def teardown(self):
if os.getenv('PYGAL_KEEP_STATE'):
return
del self.state
self.state = None

Loading…
Cancel
Save