Browse files

Ensure the test suite is executed against the local tornado modules.

This is achieved by injecting the path of the tornado module in which
the test suite is located in our sys.path.
  • Loading branch information...
1 parent d37ac92 commit 9d2449527eab16e25109b5e48ba236bebd5fbfc1 @birknilson committed Jun 20, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 tornado/test/
@@ -1,8 +1,17 @@
#!/usr/bin/env python
from __future__ import absolute_import, division, with_statement
+import sys
+import os.path
import unittest
+# Ensure we utilize the same tornado module in which this test suite resides.
+# Otherwise, we risk executing the tests against our site-packages -
+# effectively compromising the integrity of our tests.
+TORNADO_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))
+sys.path.insert(1, TORNADO_DIR)

0 comments on commit 9d24495

Please sign in to comment.