Merge pull request #170243 from fabaff/flask-testing-fix

python3Packages.flask-testing: disable failing tests
This commit is contained in:
Fabian Affolter 2022-04-30 11:34:59 +02:00 committed by GitHub
commit 25063a9979
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 76 deletions

View file

@ -1,32 +1,58 @@
{ lib, stdenv, fetchPypi, buildPythonPackage, isPy3k, flask, blinker, twill }:
{ lib
, stdenv
, blinker
, pytestCheckHook
, buildPythonPackage
, fetchPypi
, flask
, pythonOlder
}:
buildPythonPackage rec {
pname = "Flask-Testing";
pname = "flask-testing";
version = "0.8.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "0a734d7b68e63a9410b413cd7b1f96456f9a858bd09a6222d465650cc782eb01";
pname = "Flask-Testing";
inherit version;
hash = "sha256-CnNNe2jmOpQQtBPNex+WRW+ahYvQmmIi1GVlDMeC6wE=";
};
postPatch = ''
substituteInPlace setup.py --replace "twill==0.9.1" "twill"
'';
propagatedBuildInputs = [
flask
];
propagatedBuildInputs = [ flask ];
checkInputs = [
blinker
pytestCheckHook
];
checkInputs = [ blinker ] ++ lib.optionals (!isPy3k) [ twill ];
# Some of the tests use localhost networking on darwin
doCheck = !stdenv.isDarwin;
# twill integration is outdated in Python 2, hence it the tests fails.
# Some of the tests use localhost networking on darwin.
doCheck = isPy3k && !stdenv.isDarwin;
disabledTests = [
# RuntimeError and NotImplementedError
"test_assert_redirects"
"test_server_listening"
"test_server_process_is_spawned"
];
pythonImportsCheck = [ "flask_testing" ];
disabledTestPaths = [
# twill is only used by Python 2 according setup.py
"tests/test_twill.py"
];
pythonImportsCheck = [
"flask_testing"
];
meta = with lib; {
description = "Flask unittest integration.";
description = "Extension provides unit testing utilities for Flask";
homepage = "https://pythonhosted.org/Flask-Testing/";
license = licenses.bsd3;
maintainers = [ maintainers.mic92 ];
maintainers = with maintainers; [ mic92 ];
};
}

View file

@ -1,6 +1,6 @@
{ buildPythonPackage
, lib
, isPy27
{ lib
, buildPythonPackage
, pythonOlder
, nixosTests
, fetchPypi
, alembic
@ -29,7 +29,6 @@
, python-dateutil
, pytz
, requests
, six
, sqlalchemy
, sqlalchemy-utils
, sqlalchemy-continuum
@ -37,83 +36,85 @@
, werkzeug
, wtforms
, psycopg2 # optional, for postgresql support
, flask_testing
, flask-testing
, pytestCheckHook
, fetchpatch
}:
buildPythonPackage rec {
pname = "ihatemoney";
version = "5.1.1";
version = "5.2.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "0gsqba9qbs1dpmfys8qpiahy4pbn4khcc6mgmdnhssmkjsb94sx6";
sha256 = "sha256-uQgZBbpqqbZYHpR+GwHWX0c7di2rVvEz0jPRY6+BkkQ=";
};
disabled = isPy27;
propagatedBuildInputs = [
aniso8601
Babel
blinker
cachetools
click
debts
dnspython
email_validator
flask
flask-babel
flask-cors
flask_mail
flask_migrate
flask_wtf
flask-babel
flask-cors
flask-restful
flask-talisman
flask_wtf
idna
itsdangerous
jinja2
Mako
markupsafe
psycopg2
python-dateutil
pytz
requests
six
sqlalchemy
sqlalchemy-continuum
werkzeug
wtforms
psycopg2
debts
];
patches = [
# fix build with wtforms 3. remove with next release
(fetchpatch {
url = "https://github.com/spiral-project/ihatemoney/commit/40ce32d9fa58a60d26a4d0df547b8deb709c330d.patch";
sha256 = "sha256-2ewOu21qhq/AOZaE9qrF5J6HH0h6ohFgjDb+BYjJnuQ=";
excludes = [ "setup.cfg" ];
})
];
postPatch = ''
substituteInPlace setup.cfg \
--replace "cachetools>=4.1,<5" "cachetools>=4.1" \
--replace "Flask-WTF>=0.14.3,<1" "Flask-WTF>=0.14.3,<2" \
--replace "SQLAlchemy>=1.3.0,<1.4" "SQLAlchemy>=1.3.0,<1.5" \
--replace "WTForms>=2.3.1,<2.4" "WTForms" \
--replace "Flask-Talisman>=0.8,<1" "Flask-Talisman>=0.8,<2" # https://github.com/spiral-project/ihatemoney/pull/1006
--replace "WTForms>=2.3.1,<3.1" "WTForms"
'';
checkInputs = [
flask_testing
flask-testing
pytestCheckHook
];
pythonImportsCheck = [ "ihatemoney" ];
pythonImportsCheck = [
"ihatemoney"
];
disabledTests = [
"test_notifications" # requires running service.
"test_invite" # requires running service.
"test_invitation_email_failure" # requires dns resolution
# Requires running service
"test_notifications"
"test_invite"
"test_access_other_projects"
"test_authentication"
"test_manage_bills"
"test_member_delete_method"
"test_membership"
"test_bill_add_remove_add"
"test_clear_ip_records"
"test_disable_clear_no_new_records"
"test_logs_for_common_actions"
# Requires DNS resolution
"test_invitation_email_failure"
];
passthru.tests = {
@ -121,9 +122,9 @@ buildPythonPackage rec {
};
meta = with lib; {
description = "Shared budget manager web application";
homepage = "https://ihatemoney.org";
description = "A simple shared budget manager web application";
license = licenses.beerware;
maintainers = [ maintainers.symphorien ];
maintainers = with maintainers; [ symphorien ];
};
}

View file

@ -1,40 +1,57 @@
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, requests
, pytestCheckHook, flask, flask-cors, dbus-python, mock, isPy27
, poetry-core }:
{ lib
, stdenv
, buildPythonPackage
, dbus-python
, fetchFromGitHub
, flask
, flask-cors
, poetry-core
, pythonOlder
, requests
}:
buildPythonPackage rec {
pname = "SwSpotify";
pname = "swspotify";
version = "1.2.3";
disabled = isPy27;
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "SwagLyrics";
repo = "SwSpotify";
rev = "v${version}";
sha256 = "sha256-xGLvc154xnje45Akf7H1qqQRUc03gGVt8AhGlkcP3kY=";
hash = "sha256-xGLvc154xnje45Akf7H1qqQRUc03gGVt8AhGlkcP3kY=";
};
nativeBuildInputs = [ poetry-core ];
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [ requests flask flask-cors ]
++ lib.optionals stdenv.isLinux [ dbus-python ];
propagatedBuildInputs = [
dbus-python
flask
flask-cors
requests
];
doCheck = !stdenv.isDarwin;
checkPhase = ''
pytest tests/test_spotify.py::${if stdenv.isDarwin then "DarwinTests" else "LinuxTests"}
postPatch = ''
# Detection of the platform doesn't always works with 1.2.3
substituteInPlace pyproject.toml \
--replace 'dbus-python = {version = "^1.2.16", platform = "linux"}' ""
'';
checkInputs = [ pytestCheckHook mock ];
# Tests want to use Dbus
doCheck = false;
pythonImportsCheck = [ "SwSpotify" ];
pythonImportsCheck = [
"SwSpotify"
];
meta = with lib; {
homepage = "https://github.com/SwagLyrics/SwSpotify";
description = "Library to get the currently playing song and artist from Spotify";
homepage = "https://github.com/SwagLyrics/SwSpotify";
license = licenses.mit;
maintainers = with maintainers; [ siraben ];
platforms = platforms.unix;
};
}

View file

@ -1,18 +1,38 @@
{ lib, python3, fetchFromGitHub, ncurses }:
{ lib
, python3
, fetchFromGitHub
, ncurses
}:
python3.pkgs.buildPythonApplication rec {
pname = "swaglyrics";
version = "unstable-2021-06-17";
format = "setuptools";
src = fetchFromGitHub {
owner = "SwagLyrics";
repo = "SwagLyrics-For-Spotify";
rev = "99fe764a9e45cac6cb9fcdf724c7d2f8cb4524fb";
sha256 = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
hash = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0=";
};
propagatedBuildInputs = with python3.pkgs; [
unidecode colorama beautifulsoup4 flask requests swspotify
beautifulsoup4
colorama
flask
requests
swspotify
unidecode
];
checkInputs = with python3.pkgs; [
blinker
flask
flask-testing
mock
pytestCheckHook
] ++ [
ncurses
];
preConfigure = ''
@ -22,10 +42,12 @@ python3.pkgs.buildPythonApplication rec {
--replace 'flask==2.0.1' 'flask>=2.0.1'
'';
preBuild = "export HOME=$NIX_BUILD_TOP";
preBuild = ''
export HOME=$(mktemp -d)
'';
# disable tests which touch network
disabledTests = [
# Disable tests which touch network
"test_database_for_unsupported_song"
"test_that_lyrics_works_for_unsupported_songs"
"test_that_get_lyrics_works"
@ -33,9 +55,9 @@ python3.pkgs.buildPythonApplication rec {
"test_songchanged_can_raise_songplaying"
];
checkInputs = with python3.pkgs;
[ blinker swspotify pytestCheckHook flask mock flask_testing ]
++ [ ncurses ];
pythonImportsCheck = [
"swaglyrics"
];
meta = with lib; {
description = "Lyrics fetcher for currently playing Spotify song";

View file

@ -64,6 +64,7 @@ mapAliases ({
dogpile-core = throw "dogpile-core is no longer maintained, use dogpile-cache instead"; # added 2021-11-20
eebrightbox = throw "eebrightbox is unmaintained upstream and has therefore been removed"; # added 2022-02-03
faulthandler = throw "faulthandler is built into ${python.executable}"; # added 2021-07-12
flask_testing = flask-testing; # added 2022-04-25
garminconnect-ha = garminconnect; # added 2022-02-05
gitdb2 = throw "gitdb2 has been deprecated, use gitdb instead."; # added 2020-03-14
glances = throw "glances has moved to pkgs.glances"; # added 2020-20-28

View file

@ -3072,7 +3072,7 @@ in {
flask-talisman = callPackage ../development/python-modules/flask-talisman { };
flask_testing = callPackage ../development/python-modules/flask-testing { };
flask-testing = callPackage ../development/python-modules/flask-testing { };
flask-versioned = callPackage ../development/python-modules/flask-versioned { };