Accepting request 244314 from home:Nijel:branches:devel:languages:python

- Run test suite during build (required disabling of one test as 
  it is known to be broken)

OBS-URL: https://build.opensuse.org/request/show/244314
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pytz?expand=0&rev=23
This commit is contained in:
Michal Čihař 2014-08-12 13:50:27 +00:00 committed by Git OBS Bridge
parent 9a62e7bc7b
commit 49dbb584d0
3 changed files with 31 additions and 3 deletions

18
fix-tests.patch Normal file
View File

@ -0,0 +1,18 @@
--- a/pytz/tests/test_tzinfo.py
+++ b/pytz/tests/test_tzinfo.py
@@ -694,15 +694,6 @@
'1914-01-01 13:40:00 UTC+0000'
)
- def no_testCreateLocaltime(self):
- # It would be nice if this worked, but it doesn't.
- tz = pytz.timezone('Europe/Amsterdam')
- dt = datetime(2004, 10, 31, 2, 0, 0, tzinfo=tz)
- self.assertEqual(
- dt.strftime(fmt),
- '2004-10-31 02:00:00 CET+0100'
- )
-
class CommonTimezonesTestCase(unittest.TestCase):
def test_bratislava(self):

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 24 09:41:38 UTC 2014 - mcihar@suse.com
- Run test suite during build (required disabling of one test as
it is known to be broken)
-------------------------------------------------------------------
Wed Jul 23 12:08:31 UTC 2014 - mcihar@suse.cz

View File

@ -24,9 +24,11 @@ License: MIT
Group: Development/Languages/Python
Url: http://pytz.sourceforge.net
Source: http://pypi.python.org/packages/source/p/pytz/pytz-%{version}.tar.bz2
# PATCH-FIX-UPSTREAM fix-tests.patch -- Remote tests which are known to be broken
Patch0: fix-tests.patch
BuildRequires: fdupes
BuildRequires: python-devel
#BuildRequires: python-nose
BuildRequires: python-nose
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@ -49,6 +51,8 @@ Amost all of the Olson timezones are supported.
%prep
%setup -q -n pytz-%{version}
# Disable test which is not working (and documented so)
%patch0 -p1
# For rpmlint warning: remove shebang from python library:
sed -i '/^#!/d' ./pytz/tzfile.py
@ -59,8 +63,8 @@ python setup.py build
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes %{buildroot}%{python_sitelib}
#%%check
#nosetests
%check
nosetests
%files
%defattr(-,root,root,-)