Add upstream patch to run tests from project dir

This commit is contained in:
Orion Poplawski 2016-09-16 10:03:50 -06:00
parent 2c594f80c5
commit ffb114a0ba
2 changed files with 16 additions and 0 deletions

12
python-tornado-test.patch Normal file
View File

@ -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)

View File

@ -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