Skip to content

Commit

Permalink
Merge pull request #327530 from lavafroth/python3Packages.beaker/nose
Browse files Browse the repository at this point in the history
python3Packages.beaker: replace nose tests with pytest
  • Loading branch information
emilazy authored Jul 26, 2024
2 parents aed5d44 + 0add1c4 commit bad8a70
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions pkgs/development/python-modules/beaker/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
stdenv,
lib,
buildPythonPackage,
fetchFromGitHub,
glibcLocales,
nose,
pylibmc,
python-memcached,
redis,
Expand All @@ -15,24 +13,28 @@
pycrypto,
cryptography,
isPy27,
isPy3k,
pytestCheckHook,
setuptools,
funcsigs ? null,
pycryptopp ? null,
}:

buildPythonPackage rec {
pname = "beaker";
version = "1.13.0";
pyproject = true;

# The pypy release do not contains the tests
src = fetchFromGitHub {
owner = "bbangert";
repo = "beaker";
rev = "refs/tags/${version}";
sha256 = "sha256-HzjhOPXElwKoJLrhGIbVn798tbX/kaS1EpQIX+vXCtE=";
hash = "sha256-HzjhOPXElwKoJLrhGIbVn798tbX/kaS1EpQIX+vXCtE=";
};

propagatedBuildInputs =
build-system = [ setuptools ];

dependencies =
[
sqlalchemy
pycrypto
Expand All @@ -47,29 +49,19 @@ buildPythonPackage rec {
glibcLocales
python-memcached
mock
nose
pylibmc
pymongo
redis
webtest
pytestCheckHook
];

# Can not run memcached tests because it immediately tries to connect
postPatch = ''
rm tests/test_memcached.py
'';

# Can not run memcached tests because it immediately tries to connect.
# Disable external tests because they need to connect to a live database.
# Also disable a test in test_cache.py called "test_upgrade" because
# it currently fails on darwin.
# Please see issue https://github.com/bbangert/beaker/issues/166
checkPhase = ''
nosetests \
-e ".*test_ext_.*" \
-e "test_upgrade" \
${lib.optionalString (!stdenv.isLinux) ''-e "test_cookie_expires_different_locale"''} \
-vv tests
'';
pytestFlagsArray = [
"--ignore=tests/test_memcached.py"
"--ignore-glob='tests/test_managers/test_ext_*'"
];

meta = {
description = "Session and Caching library with WSGI Middleware";
Expand Down

0 comments on commit bad8a70

Please sign in to comment.