forked from pool/python-pony
Accepting request 644334 from home:alarrosa:branches:devel:languages:python
- Added 0001-Fix-tests-failing-with-python-3.6.patch from upstream to fix the tests to run as expected. - Initial release of python-pony 0.7.6 OBS-URL: https://build.opensuse.org/request/show/644334 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pony?expand=0&rev=2
This commit is contained in:
committed by
Git OBS Bridge
parent
09b043d084
commit
674f3afc5c
35
0001-Fix-tests-failing-with-python-3.6.patch
Normal file
35
0001-Fix-tests-failing-with-python-3.6.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 890ee84634a22469e64f8a23279a40db8a22b5c2 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Tischenko <sashaaero@yandex.ru>
|
||||
Date: Wed, 3 Oct 2018 18:04:37 +0300
|
||||
Subject: [PATCH] Fixes #385: Tests fail with python3.6
|
||||
|
||||
---
|
||||
setup.py | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 892beb2a..e1689e30 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -3,6 +3,13 @@
|
||||
from setuptools import setup
|
||||
import sys
|
||||
|
||||
+import unittest
|
||||
+
|
||||
+def test_suite():
|
||||
+ test_loader = unittest.TestLoader()
|
||||
+ test_suite = test_loader.discover('pony.orm.tests', pattern='test_*.py')
|
||||
+ return test_suite
|
||||
+
|
||||
name = "pony"
|
||||
version = __import__('pony').__version__
|
||||
description = "Pony Object-Relational Mapper"
|
||||
@@ -116,5 +123,6 @@
|
||||
license=licence,
|
||||
packages=packages,
|
||||
package_data=package_data,
|
||||
- download_url=download_url
|
||||
+ download_url=download_url,
|
||||
+ test_suite='setup.test_suite'
|
||||
)
|
@@ -1,38 +0,0 @@
|
||||
Index: pony-0.7.6/pony/orm/tests/test_show.py
|
||||
===================================================================
|
||||
--- pony-0.7.6.orig/pony/orm/tests/test_show.py
|
||||
+++ pony-0.7.6/pony/orm/tests/test_show.py
|
||||
@@ -53,7 +53,10 @@ class TestShow(unittest.TestCase):
|
||||
|
||||
def test_1(self):
|
||||
Student.select().show()
|
||||
- self.assertEqual('\n'+sys.stdout.getvalue().replace(' ', '~'), '''
|
||||
+ txt = sys.stdout.getvalue().replace(' ', '~')
|
||||
+ txt = txt[txt.index('id|'):]
|
||||
+
|
||||
+ self.assertEqual('\n'+txt, '''
|
||||
id|name|scholarship|gpa|dob~~~~~~~|group~~~
|
||||
--+----+-----------+---+----------+--------
|
||||
1~|S1~~|None~~~~~~~|3.1|None~~~~~~|Group[1]
|
||||
@@ -63,7 +66,9 @@ id|name|scholarship|gpa|dob~~~~~~~|group
|
||||
|
||||
def test_2(self):
|
||||
Group.select().show()
|
||||
- self.assertEqual('\n'+sys.stdout.getvalue().replace(' ', '~'), '''
|
||||
+ txt = sys.stdout.getvalue().replace(' ', '~')
|
||||
+ txt = txt[txt.index('number\n'):]
|
||||
+ self.assertEqual('\n'+txt, '''
|
||||
number
|
||||
------
|
||||
1~~~~~
|
||||
Index: pony-0.7.6/pony/orm/tests/__init__.py
|
||||
===================================================================
|
||||
--- pony-0.7.6.orig/pony/orm/tests/__init__.py
|
||||
+++ pony-0.7.6/pony/orm/tests/__init__.py
|
||||
@@ -1,4 +1,4 @@
|
||||
import pony.orm.core, pony.options
|
||||
|
||||
pony.options.CUT_TRACEBACK = False
|
||||
-pony.orm.core.sql_debug(False)
|
||||
\ No newline at end of file
|
||||
+pony.orm.core.sql_debug(True)
|
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 24 11:48:53 UTC 2018 - Antonio Larrosa <alarrosa@suse.com>
|
||||
|
||||
- Added 0001-Fix-tests-failing-with-python-3.6.patch from upstream
|
||||
to fix the tests to run as expected.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 24 12:19:58 UTC 2018 - Antonio Larrosa <alarrosa@suse.com> - 0.7.6
|
||||
|
||||
|
@@ -12,24 +12,25 @@
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-pony
|
||||
Version: 0.7.6
|
||||
Release: 0
|
||||
License: Apache-2.0
|
||||
Summary: Pony Object-Relational Mapper
|
||||
Url: https://ponyorm.com
|
||||
License: Apache-2.0
|
||||
Group: Development/Languages/Python
|
||||
Url: https://ponyorm.com
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pony/pony-%{version}.tar.gz
|
||||
Source99: https://raw.githubusercontent.com/ponyorm/pony/orm/LICENSE
|
||||
#Patch0: fix-tests.patch
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: dos2unix
|
||||
Patch0: 0001-Fix-tests-failing-with-python-3.6.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: dos2unix
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildArch: noarch
|
||||
|
||||
%python_subpackages
|
||||
@@ -44,7 +45,7 @@ a generator and translates it to its SQL equivalent.
|
||||
|
||||
%prep
|
||||
%setup -q -n pony-%{version}
|
||||
#%%patch0 -p1
|
||||
%patch0 -p1
|
||||
cp %{S:99} .
|
||||
dos2unix README.md
|
||||
|
||||
@@ -55,9 +56,8 @@ dos2unix README.md
|
||||
%python_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
#%%check
|
||||
# Disabled until https://github.com/ponyorm/pony/issues/385 is fixed
|
||||
#%%python_exec setup.py test
|
||||
%check
|
||||
%python_exec setup.py test
|
||||
|
||||
%files %{python_files}
|
||||
%doc README.md
|
||||
|
Reference in New Issue
Block a user