From 444dbe568dd39ef50ad3905e29abe494c11f13b4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 30 Aug 2017 14:39:25 +0200 Subject: community/python-faker: disable century-tests (which require > 32 bit) --- community/python-faker/PKGBUILD | 14 +++++++++++ community/python-faker/remove-century-tests.patch | 30 +++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 community/python-faker/PKGBUILD create mode 100644 community/python-faker/remove-century-tests.patch (limited to 'community') diff --git a/community/python-faker/PKGBUILD b/community/python-faker/PKGBUILD new file mode 100644 index 00000000..88b903c8 --- /dev/null +++ b/community/python-faker/PKGBUILD @@ -0,0 +1,14 @@ +# time-tests requiring 64 bit fail on i686 - obviously + +source+=('remove-century-tests.patch') +sha512sums+=('0db0780b0fbb89b4bff35fce4bc18e1f1ecafb46d55f00b4391f8f2a8f66e0244b3b988d67d922c3c206917404ee5ca6beb3f0cbd2b20c167179a2681aaf0782') + +eval "$( + declare -f prepare | \ + sed ' + /^{\s*$/a \ + cd "$srcdir"/faker-$pkgver\ + patch -p1 -i "$srcdir/remove-century-tests.patch"\ + cd "$srcdir" + ' +)" diff --git a/community/python-faker/remove-century-tests.patch b/community/python-faker/remove-century-tests.patch new file mode 100644 index 00000000..5c944377 --- /dev/null +++ b/community/python-faker/remove-century-tests.patch @@ -0,0 +1,30 @@ +--- a/tests/providers/date_time.py 2017-08-30 14:27:30.361571816 +0200 ++++ b/tests/providers/date_time.py 2017-08-30 14:28:01.231669046 +0200 +@@ -162,9 +162,6 @@ + return int(time.mktime(value.timetuple())) + + def test_date_time_this_period(self): +- # test century +- self.assertTrue(self._datetime_to_time(self.factory.date_time_this_century(after_now=False)) <= self._datetime_to_time(datetime.now())) +- self.assertTrue(self._datetime_to_time(self.factory.date_time_this_century(before_now=False, after_now=True)) >= self._datetime_to_time(datetime.now())) + # test decade + self.assertTrue(self._datetime_to_time(self.factory.date_time_this_decade(after_now=False)) <= self._datetime_to_time(datetime.now())) + self.assertTrue(self._datetime_to_time(self.factory.date_time_this_decade(before_now=False, after_now=True)) >= self._datetime_to_time(datetime.now())) +@@ -190,17 +187,12 @@ + def test_date_time_this_period_with_tzinfo(self): + # ensure all methods provide timezone aware datetimes + with self.assertRaises(TypeError): +- self.factory.date_time_this_century(before_now=False, after_now=True, tzinfo=utc) >= datetime.now() +- with self.assertRaises(TypeError): + self.factory.date_time_this_decade(after_now=False, tzinfo=utc) <= datetime.now() + with self.assertRaises(TypeError): + self.factory.date_time_this_year(after_now=False, tzinfo=utc) <= datetime.now() + with self.assertRaises(TypeError): + self.factory.date_time_this_month(after_now=False, tzinfo=utc) <= datetime.now() + +- # test century +- self.assertTrue(self.factory.date_time_this_century(after_now=False, tzinfo=utc) <= datetime.now(utc)) +- self.assertTrue(self.factory.date_time_this_century(before_now=False, after_now=True, tzinfo=utc) >= datetime.now(utc)) + # test decade + self.assertTrue(self.factory.date_time_this_decade(after_now=False, tzinfo=utc) <= datetime.now(utc)) + self.assertTrue(self.factory.date_time_this_decade(before_now=False, after_now=True, tzinfo=utc) >= datetime.now(utc)) -- cgit v1.2.3-70-g09d2