From c4aeba3f54eca687dd11837d1ec59de9f82c1cf6 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 30 Sep 2016 11:13:51 -0400 Subject: tests: silence the Cheetah UserWarning about NameMapper C version. This silences a warning made by Cheetah in pip installed environments: UserWarning: You don't have the C version of NameMapper installed! I'm disabling Cheetah's useStackFrames option ... The reason for the monkey patching is that the warning goes to stderr during nose and breaks up its expected output. The side affect of it is that tests would run with Cheetah's 'useStackFrames' enabled which is "painfully slow with the Python version of NameMapper". --- tests/unittests/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/unittests/__init__.py') diff --git a/tests/unittests/__init__.py b/tests/unittests/__init__.py index e69de29b..1b34b5af 100644 --- a/tests/unittests/__init__.py +++ b/tests/unittests/__init__.py @@ -0,0 +1,9 @@ +try: + # For test cases, avoid the following UserWarning to stderr: + # You don't have the C version of NameMapper installed ... + from Cheetah import NameMapper as _nm + _nm.C_VERSION = True +except ImportError: + pass + +# vi: ts=4 expandtab -- cgit v1.2.3