mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
gnu: python-aionotify: Fix test cases with Python 3.8.
* gnu/packages/python-xyz.scm (patches): Add fix. * gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch: New file. * gnu/local.mk: Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
4071879c86
commit
64066abdb0
3 changed files with 51 additions and 2 deletions
|
@ -1450,6 +1450,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/python-3.8-fix-tests.patch \
|
%D%/packages/patches/python-3.8-fix-tests.patch \
|
||||||
%D%/packages/patches/python-CVE-2018-14647.patch \
|
%D%/packages/patches/python-CVE-2018-14647.patch \
|
||||||
%D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch \
|
%D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch \
|
||||||
|
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
|
||||||
%D%/packages/patches/python-alembic-exceptions-cause.patch \
|
%D%/packages/patches/python-alembic-exceptions-cause.patch \
|
||||||
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
|
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
|
||||||
%D%/packages/patches/python-axolotl-AES-fix.patch \
|
%D%/packages/patches/python-axolotl-AES-fix.patch \
|
||||||
|
|
48
gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch
Normal file
48
gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
Compatibility with Python 3.8, see upstream issue
|
||||||
|
https://github.com/rbarrois/aionotify/pull/15
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 21a554f..094de64 100755
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -40,7 +40,7 @@ setup(
|
||||||
|
setup_requires=[
|
||||||
|
],
|
||||||
|
tests_require=[
|
||||||
|
- 'asynctest',
|
||||||
|
+ 'asynctest; python_version<"3.8"',
|
||||||
|
],
|
||||||
|
classifiers=[
|
||||||
|
"Development Status :: 4 - Beta",
|
||||||
|
diff --git a/tests/test_usage.py b/tests/test_usage.py
|
||||||
|
index f156291..0476ff1 100644
|
||||||
|
--- a/tests/test_usage.py
|
||||||
|
+++ b/tests/test_usage.py
|
||||||
|
@@ -8,7 +8,11 @@ import os.path
|
||||||
|
import tempfile
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
-import asynctest
|
||||||
|
+try:
|
||||||
|
+ testBase = unittest.IsolatedAsyncioTestCase
|
||||||
|
+except AttributeError:
|
||||||
|
+ import asynctest
|
||||||
|
+ testBase = asynctest.TestCase
|
||||||
|
|
||||||
|
import aionotify
|
||||||
|
|
||||||
|
@@ -25,11 +29,13 @@ if AIODEBUG:
|
||||||
|
TESTDIR = os.environ.get('AIOTESTDIR') or os.path.join(os.path.dirname(__file__), 'testevents')
|
||||||
|
|
||||||
|
|
||||||
|
-class AIONotifyTestCase(asynctest.TestCase):
|
||||||
|
+class AIONotifyTestCase(testBase):
|
||||||
|
forbid_get_event_loop = True
|
||||||
|
timeout = 3
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
+ if not getattr (self, 'loop', None):
|
||||||
|
+ self.loop = asyncio.get_event_loop()
|
||||||
|
if AIODEBUG:
|
||||||
|
self.loop.set_debug(True)
|
||||||
|
self.watcher = aionotify.Watcher()
|
|
@ -19269,9 +19269,9 @@ (define-public python-aionotify
|
||||||
(commit (string-append "v" version))))
|
(commit (string-append "v" version))))
|
||||||
(file-name (git-file-name name version))
|
(file-name (git-file-name name version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y"))))
|
(base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y"))
|
||||||
|
(patches (search-patches "python-aionotify-0.2.0-py3.8.patch"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(native-inputs `(("python-asynctest" ,python-asynctest)))
|
|
||||||
(home-page "https://github.com/rbarrois/aionotify")
|
(home-page "https://github.com/rbarrois/aionotify")
|
||||||
(synopsis "Asyncio-powered inotify library")
|
(synopsis "Asyncio-powered inotify library")
|
||||||
(description
|
(description
|
||||||
|
|
Loading…
Reference in a new issue