Skip to content

Commit

Permalink
python311Packages.flask-restful: fix tests
Browse files Browse the repository at this point in the history
Signals are now always available, since flask depends on blinker.
  • Loading branch information
mweinelt committed Jan 26, 2024
1 parent 2cee7f3 commit 5313701
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/flask-restful/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 5313701

Please sign in to comment.