Hi,

la 7. marrask. 2020 klo 9.38 Juhani Numminen
(juhaninummin...@gmail.com) kirjoitti:
> Fedora have decided to disable the failing part of that test.[1]
> Python docs for the tested function now state "Changed in version 3.9:
> This method now accepts zero for k."[2]
>
> [1] 
> https://src.fedoraproject.org/rpms/python-random2/blob/master/f/python-random2.spec#_39
> [2] https://docs.python.org/3/library/random.html#random.getrandbits

I propose the attached pyrandom2 NMU which aims to fix py3.9 test failures.
I will try to see if someone could sponsor the upload for me.

Thanks,
--
Juhani
diff -Nru pyrandom2-1.0.1/debian/changelog pyrandom2-1.0.1/debian/changelog
--- pyrandom2-1.0.1/debian/changelog	2019-08-02 14:43:29.000000000 +0300
+++ pyrandom2-1.0.1/debian/changelog	2020-11-24 20:26:34.000000000 +0200
@@ -1,3 +1,10 @@
+pyrandom2 (1.0.1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add python3.9.patch fixing tests with py3.9 (Closes: #973085).
+
+ -- Juhani Numminen <juhaninummin...@gmail.com>  Tue, 24 Nov 2020 20:26:34 +0200
+
 pyrandom2 (1.0.1-2) unstable; urgency=medium
 
   * Drop Python 2 support.
diff -Nru pyrandom2-1.0.1/debian/patches/python3.9.patch pyrandom2-1.0.1/debian/patches/python3.9.patch
--- pyrandom2-1.0.1/debian/patches/python3.9.patch	1970-01-01 02:00:00.000000000 +0200
+++ pyrandom2-1.0.1/debian/patches/python3.9.patch	2020-11-24 20:26:34.000000000 +0200
@@ -0,0 +1,31 @@
+Description: fix tests with python 3.9
+ Python docs for the function being tested now state:
+ "Changed in version 3.9: This method now accepts zero for k."
+ https://docs.python.org/3/library/random.html#random.getrandbits
+Author: Juhani Numminen <juhaninummin...@gmail.com>
+Bug-Debian: https://bugs.debian.org/973085
+Last-Update: 2020-11-24
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -291,7 +291,8 @@
+         # Verify argument checking
+         self.assertRaises(TypeError, self.gen.getrandbits)
+         self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+-        self.assertRaises(ValueError, self.gen.getrandbits, 0)
++        if sys.version_info < (3, 9):
++            self.assertRaises(ValueError, self.gen.getrandbits, 0)
+         self.assertRaises(ValueError, self.gen.getrandbits, -1)
+         self.assertRaises(TypeError, self.gen.getrandbits, 10.1)
+ 
+@@ -448,7 +449,8 @@
+         self.assertRaises(TypeError, self.gen.getrandbits)
+         self.assertRaises(TypeError, self.gen.getrandbits, 'a')
+         self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+-        self.assertRaises(ValueError, self.gen.getrandbits, 0)
++        if sys.version_info < (3, 9):
++            self.assertRaises(ValueError, self.gen.getrandbits, 0)
+         self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ 
+     def test_randbelow_logic(self, _log=log, int=int):
diff -Nru pyrandom2-1.0.1/debian/patches/series pyrandom2-1.0.1/debian/patches/series
--- pyrandom2-1.0.1/debian/patches/series	1970-01-01 02:00:00.000000000 +0200
+++ pyrandom2-1.0.1/debian/patches/series	2020-11-23 13:28:38.000000000 +0200
@@ -0,0 +1 @@
+python3.9.patch

Reply via email to