Skip to content

Commit

Permalink
Use reset_pyparsing_context for each example in test_examples.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ptmcg committed Jul 28, 2023
1 parent eb9db9e commit 5b939cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
from importlib import import_module
import unittest

from pyparsing import testing as ppt


class TestExamples(unittest.TestCase):
def _run(self, name):
mod = import_module("examples." + name)
getattr(mod, "main", lambda *args, **kwargs: None)()

# use pyparsing context to reset each test to clean
# pyparsing settings
with ppt.reset_pyparsing_context():
getattr(mod, "main", lambda *args, **kwargs: None)()

def test_numerics(self):
self._run("numerics")
Expand Down

0 comments on commit 5b939cc

Please sign in to comment.