Skip to content

Commit

Permalink
Tests(ImportHooks): Add a reproducible test case for infinite recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
phdru committed Sep 11, 2019
1 parent 91727f0 commit fe0ff3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cheetah/Tests/ImportHooks.py
Expand Up @@ -4,6 +4,7 @@
import sys
import unittest
import Cheetah.ImportHooks
from Cheetah.compat import PY2


ImportHooksTemplatesDir = os.path.join(
Expand Down Expand Up @@ -85,3 +86,10 @@ def test_import_builtin(self):
__import__(nm)
return
raise self.fail("All builtin modules are imported")

if not PY2:
def test_import_bootlocale(self):
if '_bootlocale' in sys.modules:
del sys.modules['_bootlocale']
Cheetah.ImportHooks.install()
import _bootlocale

0 comments on commit fe0ff3b

Please sign in to comment.