diff --git a/demo/moulinrouge/tests.py b/demo/moulinrouge/tests.py index 46b33eb..06930e6 100644 --- a/demo/moulinrouge/tests.py +++ b/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()))) diff --git a/pygal/graph/base.py b/pygal/graph/base.py index 9d81439..7699154 100644 --- a/pygal/graph/base.py +++ b/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