summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-09-30 11:13:51 -0400
committerScott Moser <smoser@brickies.net>2016-10-07 12:29:43 -0400
commitc4aeba3f54eca687dd11837d1ec59de9f82c1cf6 (patch)
treebc81ed4ef2e6992ae03a2db64ae4bf9f7c3c0f14
parent6e45ffb21e9622780585b4fe15890f009ca8fa71 (diff)
downloadvyos-cloud-init-c4aeba3f54eca687dd11837d1ec59de9f82c1cf6.tar.gz
vyos-cloud-init-c4aeba3f54eca687dd11837d1ec59de9f82c1cf6.zip
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".
-rw-r--r--tests/unittests/__init__.py9
1 files changed, 9 insertions, 0 deletions
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