From 243feb9e8aea1cbe13244e44bc4ba2f590e8ae80 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 25 Jul 2016 23:45:45 -0400 Subject: [PATCH 1/2] travis.yml: Reproduce #1780 in CI --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16f61830..7d6b79a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,9 +30,13 @@ install: - curl-config --version; pip freeze script: - # Get out of the source directory before running tests to avoid PYTHONPATH - # confusion. This is necessary to ensure that the speedups module can - # be found in the installation directory. + # Run the tests once from the source directory to detect issues + # involving relative __file__ paths; see + # https://github.com/tornadoweb/tornado/issues/1780 + - unset TORNADO_EXTENSION && python -m tornado.test + # For all other test variants, get out of the source directory before + # running tests to ensure that we get the installed speedups module + # instead of the source directory which doesn't have it. - cd maint # Copy the coveragerc down so coverage.py can find it. - cp ../.coveragerc . From d588bfb77d8064e5f98fc77bbc42aa369987561c Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Tue, 26 Jul 2016 00:03:11 -0400 Subject: [PATCH 2/2] options_test: Absolutize __file__ Python 3.4 guarantees an absolute path, but in older versions relative paths are used in some cases. Fixes #1780 --- tornado/test/options_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/test/options_test.py b/tornado/test/options_test.py index f7b215c5..c050cb64 100644 --- a/tornado/test/options_test.py +++ b/tornado/test/options_test.py @@ -36,7 +36,7 @@ class OptionsTest(unittest.TestCase): options.define("port", default=80) options.define("username", default='foo') options.define("my_path") - config_path = os.path.join(os.path.dirname(__file__), + config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "options_test.cfg") options.parse_config_file(config_path) self.assertEqual(options.port, 443)