Skip to content

Commit

Permalink
pythonPackage.celery: fix tests
Browse files Browse the repository at this point in the history
(cherry picked from commit 47a3a11)
  • Loading branch information
Jonathan Ringer authored and Ma27 committed Sep 16, 2019
1 parent e4d1964 commit cb2bda9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pkgs/development/python-modules/celery/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, iana-etc, libredirect
{ lib, buildPythonPackage, fetchPypi, libredirect
, case, pytest, boto3, moto, kombu, billiard, pytz, anyjson, amqp, eventlet
}:

Expand All @@ -17,19 +17,17 @@ buildPythonPackage rec {
--replace "pytest>=4.3.1,<4.4.0" pytest
'';

# make /etc/protocols accessible to fix socket.getprotobyname('tcp') in sandbox
preCheck = stdenv.lib.optionalString stdenv.isLinux ''
export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols \
LD_PRELOAD=${libredirect}/lib/libredirect.so
'';
postCheck = stdenv.lib.optionalString stdenv.isLinux ''
unset NIX_REDIRECTS LD_PRELOAD
# ignore test that's incompatible with pytest5
# test_eventlet touches network
checkPhase = ''
pytest -k 'not restore_current_app_fallback' \
--ignore=t/unit/concurrency/test_eventlet.py
'';

checkInputs = [ case pytest boto3 moto ];
propagatedBuildInputs = [ kombu billiard pytz anyjson amqp eventlet ];

meta = with stdenv.lib; {
meta = with lib; {
homepage = https://github.com/celery/celery/;
description = "Distributed task queue";
license = licenses.bsd3;
Expand Down

0 comments on commit cb2bda9

Please sign in to comment.