forked from pool/python-pytz
Accepting request 668134 from devel:languages:python
- Replace nose test runner with pytest (py2k stdlib unittest runner is not sufficient to run the test suite here). - Refresh patches fix-tests.patch, system_zoneinfo.patch, 0001-Fix-tests-for-older-timezone-versions.patch OBS-URL: https://build.opensuse.org/request/show/668134 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytz?expand=0&rev=30
This commit is contained in:
commit
0f6986949e
@ -8,11 +8,9 @@ This improves the fix from commit c00dbe290b .
|
|||||||
src/pytz/tests/test_tzinfo.py | 26 ++++++++++++++------------
|
src/pytz/tests/test_tzinfo.py | 26 ++++++++++++++------------
|
||||||
1 file changed, 14 insertions(+), 12 deletions(-)
|
1 file changed, 14 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
diff --git a/src/pytz/tests/test_tzinfo.py b/src/pytz/tests/test_tzinfo.py
|
--- a/pytz/tests/test_tzinfo.py
|
||||||
index 3166322..0ecb8c0 100644
|
+++ b/pytz/tests/test_tzinfo.py
|
||||||
--- a/src/pytz/tests/test_tzinfo.py
|
@@ -247,12 +247,13 @@ class USEasternDSTStartTestCase(unittest
|
||||||
+++ b/src/pytz/tests/test_tzinfo.py
|
|
||||||
@@ -249,13 +249,14 @@ class USEasternDSTStartTestCase(unittest.TestCase):
|
|
||||||
|
|
||||||
def _test_tzname(self, utc_dt, wanted):
|
def _test_tzname(self, utc_dt, wanted):
|
||||||
tzname = wanted['tzname']
|
tzname = wanted['tzname']
|
||||||
@ -24,16 +22,14 @@ index 3166322..0ecb8c0 100644
|
|||||||
- 'Expected %s as tzname for %s. Got %s' % (
|
- 'Expected %s as tzname for %s. Got %s' % (
|
||||||
- tzname, str(utc_dt), dt.tzname()
|
- tzname, str(utc_dt), dt.tzname()
|
||||||
- )
|
- )
|
||||||
- )
|
|
||||||
+ self.assertIn(dt.tzname(), tzname,
|
+ self.assertIn(dt.tzname(), tzname,
|
||||||
+ 'Expected %s as tzname for %s. Got %s' % (
|
+ 'Expected %s as tzname for %s. Got %s' % (
|
||||||
+ tzname, str(utc_dt), dt.tzname()
|
+ tzname, str(utc_dt), dt.tzname()
|
||||||
+ )
|
+ )
|
||||||
+ )
|
)
|
||||||
|
|
||||||
def _test_utcoffset(self, utc_dt, wanted):
|
def _test_utcoffset(self, utc_dt, wanted):
|
||||||
utcoffset = wanted['utcoffset']
|
@@ -510,7 +511,7 @@ class NoumeaHistoryStartTestCase(USEaste
|
||||||
@@ -512,7 +514,7 @@ class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase):
|
|
||||||
'dst': timedelta(0),
|
'dst': timedelta(0),
|
||||||
}
|
}
|
||||||
after = {
|
after = {
|
||||||
@ -42,7 +38,7 @@ index 3166322..0ecb8c0 100644
|
|||||||
'utcoffset': timedelta(hours=11),
|
'utcoffset': timedelta(hours=11),
|
||||||
'dst': timedelta(0),
|
'dst': timedelta(0),
|
||||||
}
|
}
|
||||||
@@ -523,12 +525,12 @@ class NoumeaDSTEndTestCase(USEasternDSTStartTestCase):
|
@@ -521,12 +522,12 @@ class NoumeaDSTEndTestCase(USEasternDSTS
|
||||||
tzinfo = pytz.timezone('Pacific/Noumea')
|
tzinfo = pytz.timezone('Pacific/Noumea')
|
||||||
transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC)
|
transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC)
|
||||||
before = {
|
before = {
|
||||||
@ -57,7 +53,7 @@ index 3166322..0ecb8c0 100644
|
|||||||
'utcoffset': timedelta(hours=11),
|
'utcoffset': timedelta(hours=11),
|
||||||
'dst': timedelta(0),
|
'dst': timedelta(0),
|
||||||
}
|
}
|
||||||
@@ -552,7 +554,7 @@ class TahitiTestCase(USEasternDSTStartTestCase):
|
@@ -550,7 +551,7 @@ class TahitiTestCase(USEasternDSTStartTe
|
||||||
'dst': timedelta(0),
|
'dst': timedelta(0),
|
||||||
}
|
}
|
||||||
after = {
|
after = {
|
||||||
@ -66,7 +62,7 @@ index 3166322..0ecb8c0 100644
|
|||||||
'utcoffset': timedelta(hours=-10),
|
'utcoffset': timedelta(hours=-10),
|
||||||
'dst': timedelta(0),
|
'dst': timedelta(0),
|
||||||
}
|
}
|
||||||
@@ -565,12 +567,12 @@ class SamoaInternationalDateLineChange(USEasternDSTStartTestCase):
|
@@ -563,12 +564,12 @@ class SamoaInternationalDateLineChange(U
|
||||||
tzinfo = pytz.timezone('Pacific/Apia')
|
tzinfo = pytz.timezone('Pacific/Apia')
|
||||||
transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
|
transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
|
||||||
before = {
|
before = {
|
||||||
@ -81,7 +77,7 @@ index 3166322..0ecb8c0 100644
|
|||||||
'utcoffset': timedelta(hours=14),
|
'utcoffset': timedelta(hours=14),
|
||||||
'dst': timedelta(hours=1),
|
'dst': timedelta(hours=1),
|
||||||
}
|
}
|
||||||
@@ -620,7 +622,7 @@ class LocalTestCase(unittest.TestCase):
|
@@ -618,7 +619,7 @@ class LocalTestCase(unittest.TestCase):
|
||||||
|
|
||||||
loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0))
|
loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0))
|
||||||
# pre-2017a, abbreviation was NCT
|
# pre-2017a, abbreviation was NCT
|
||||||
@ -90,6 +86,3 @@ index 3166322..0ecb8c0 100644
|
|||||||
|
|
||||||
loc_time = loc_tz.localize(datetime(1940, 5, 20, 0, 0, 0))
|
loc_time = loc_tz.localize(datetime(1940, 5, 20, 0, 0, 0))
|
||||||
self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200')
|
self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200')
|
||||||
--
|
|
||||||
2.13.1
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/pytz/tests/test_tzinfo.py
|
--- a/pytz/tests/test_tzinfo.py
|
||||||
+++ b/pytz/tests/test_tzinfo.py
|
+++ b/pytz/tests/test_tzinfo.py
|
||||||
@@ -728,15 +728,6 @@
|
@@ -726,15 +726,6 @@ class LocalTestCase(unittest.TestCase):
|
||||||
'1914-01-01 13:40:00 UTC+0000'
|
'1914-01-01 13:40:00 UTC+0000'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jan 9 18:18:15 CET 2019 - mcepl@suse.com
|
||||||
|
|
||||||
|
- Replace nose test runner with pytest (py2k stdlib unittest
|
||||||
|
runner is not sufficient to run the test suite here).
|
||||||
|
- Refresh patches fix-tests.patch, system_zoneinfo.patch,
|
||||||
|
0001-Fix-tests-for-older-timezone-versions.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Dec 4 12:53:18 UTC 2018 - Matej Cepl <mcepl@suse.com>
|
Tue Dec 4 12:53:18 UTC 2018 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-pytz
|
# spec file for package python-pytz
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -34,8 +34,11 @@ Patch0: fix-tests.patch
|
|||||||
Patch1: system_zoneinfo.patch
|
Patch1: system_zoneinfo.patch
|
||||||
# PATCH-FIX-UPSTREAM 0001-Fix-tests-for-older-timezone-versions.patch -- https://code.launchpad.net/~toabctl/pytz/+git/pytz/+merge/326419
|
# PATCH-FIX-UPSTREAM 0001-Fix-tests-for-older-timezone-versions.patch -- https://code.launchpad.net/~toabctl/pytz/+git/pytz/+merge/326419
|
||||||
Patch2: 0001-Fix-tests-for-older-timezone-versions.patch
|
Patch2: 0001-Fix-tests-for-older-timezone-versions.patch
|
||||||
|
BuildRequires: %{python_module base}
|
||||||
|
# pytest is required only because of 2.7 stdlib test runner, python3
|
||||||
|
# unittest runner is sufficient.
|
||||||
|
BuildRequires: %{python_module pytest}
|
||||||
# Test requirements
|
# Test requirements
|
||||||
BuildRequires: %{python_module nose}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
BuildRequires: timezone
|
BuildRequires: timezone
|
||||||
@ -59,11 +62,7 @@ Amost all of the Olson timezones are supported.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytz-%{version}
|
%setup -q -n pytz-%{version}
|
||||||
# Disable test which is not working (and documented so)
|
%autopatch -p1
|
||||||
%patch0 -p1
|
|
||||||
# Use system tz database
|
|
||||||
%patch1 -p1
|
|
||||||
%patch2 -p2
|
|
||||||
|
|
||||||
# For rpmlint warning: remove shebang from python library:
|
# For rpmlint warning: remove shebang from python library:
|
||||||
sed -i '/^#!/d' ./pytz/tzfile.py
|
sed -i '/^#!/d' ./pytz/tzfile.py
|
||||||
@ -76,7 +75,7 @@ sed -i '/^#!/d' ./pytz/tzfile.py
|
|||||||
%python_expand rm -fr %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
%python_expand rm -fr %{buildroot}%{$python_sitelib}/pytz/zoneinfo
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%python_expand nosetests-%{$python_bin_suffix}
|
%python_expand PYTHONPATH=. py.test-%{$python_bin_suffix} -v pytz/tests
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
Index: pytz-2016.10/pytz/__init__.py
|
--- a/pytz/__init__.py
|
||||||
===================================================================
|
+++ b/pytz/__init__.py
|
||||||
--- pytz-2016.10.orig/pytz/__init__.py
|
@@ -87,23 +87,7 @@ def open_resource(name):
|
||||||
+++ pytz-2016.10/pytz/__init__.py
|
|
||||||
@@ -90,23 +90,7 @@ def open_resource(name):
|
|
||||||
for part in name_parts:
|
for part in name_parts:
|
||||||
if part == os.path.pardir or os.path.sep in part:
|
if part == os.path.pardir or os.path.sep in part:
|
||||||
raise ValueError('Bad path segment: %r' % part)
|
raise ValueError('Bad path segment: %r' % part)
|
||||||
@ -27,10 +25,8 @@ Index: pytz-2016.10/pytz/__init__.py
|
|||||||
return open(filename, 'rb')
|
return open(filename, 'rb')
|
||||||
|
|
||||||
|
|
||||||
Index: pytz-2016.10/pytz/tzfile.py
|
--- a/pytz/tzfile.py
|
||||||
===================================================================
|
+++ b/pytz/tzfile.py
|
||||||
--- pytz-2016.10.orig/pytz/tzfile.py
|
|
||||||
+++ pytz-2016.10/pytz/tzfile.py
|
|
||||||
@@ -126,7 +126,7 @@ def build_tzinfo(zone, fp):
|
@@ -126,7 +126,7 @@ def build_tzinfo(zone, fp):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import os.path
|
import os.path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user