python311Packages.flask-restful: fix tests
Signals are now always available, since flask depends on blinker.
This commit is contained in:
@@ -29,6 +29,8 @@ buildPythonPackage rec {
|
||||
# conditional so that overrides are easier for web applications
|
||||
patches = lib.optionals (lib.versionAtLeast werkzeug.version "2.1.0") [
|
||||
./werkzeug-2.1.0-compat.patch
|
||||
] ++ lib.optionals (lib.versionAtLeast flask.version "3.0.0") [
|
||||
./flask-3.0-compat.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
diff --git a/tests/test_api.py b/tests/test_api.py
|
||||
index 582ee5a..20db1f5 100644
|
||||
--- a/tests/test_api.py
|
||||
+++ b/tests/test_api.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
import json
|
||||
from flask import Flask, Blueprint, redirect, views, abort as flask_abort
|
||||
-from flask.signals import got_request_exception, signals_available
|
||||
+from flask.signals import got_request_exception
|
||||
try:
|
||||
from mock import Mock
|
||||
except:
|
||||
@@ -491,10 +491,6 @@ class APITestCase(unittest.TestCase):
|
||||
self.assertEqual(api.default_mediatype, resp.headers['Content-Type'])
|
||||
|
||||
def test_handle_error_signal(self):
|
||||
- if not signals_available:
|
||||
- # This test requires the blinker lib to run.
|
||||
- print("Can't test signals without signal support")
|
||||
- return
|
||||
app = Flask(__name__)
|
||||
api = flask_restful.Api(app)
|
||||
|
||||
Reference in New Issue
Block a user