From ffb114a0bacd05299990fb5e1ad2e02f86f4dbe2 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Sep 16 2016 16:03:50 +0000 Subject: Add upstream patch to run tests from project dir --- diff --git a/python-tornado-test.patch b/python-tornado-test.patch new file mode 100644 index 0000000..eea16b5 --- /dev/null +++ b/python-tornado-test.patch @@ -0,0 +1,12 @@ +diff -up tornado-4.4.1/tornado/test/options_test.py.test tornado-4.4.1/tornado/test/options_test.py +--- tornado-4.4.1/tornado/test/options_test.py.test 2016-07-15 09:00:52.000000000 -0600 ++++ tornado-4.4.1/tornado/test/options_test.py 2016-09-16 10:01:19.542583874 -0600 +@@ -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) diff --git a/python-tornado.spec b/python-tornado.spec index 540d4a4..cb24e45 100644 --- a/python-tornado.spec +++ b/python-tornado.spec @@ -15,6 +15,9 @@ URL: http://www.tornadoweb.org Source0: https://pypi.python.org/packages/source/t/tornado/tornado-%{version}.tar.gz # Patch to use system CA certs instead of certifi Patch0: python-tornado-cert.patch +# Patch to run tests from project dir +# https://github.com/tornadoweb/tornado/pull/1781 +Patch1: python-tornado-test.patch BuildRequires: python2-devel BuildRequires: python2-backports_abc @@ -96,6 +99,7 @@ ideal for real-time web services. %prep %setup -q -n %{srcname}-%{version} %patch0 -p1 -b .cert +%patch1 -p1 -b .test # remove shebang from files %{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py