mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
pythonPackages.django_silk: enable tests
This commit is contained in:
parent
bd89694ca3
commit
0fb023825e
|
@ -1,6 +1,7 @@
|
|||
{ stdenv
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, python
|
||||
, fetchFromGitHub
|
||||
, django
|
||||
, pygments
|
||||
, simplejson
|
||||
|
@ -13,18 +14,31 @@
|
|||
, pillow
|
||||
, mock
|
||||
, gprof2dot
|
||||
, freezegun
|
||||
, contextlib2
|
||||
, networkx
|
||||
, pydot
|
||||
, factory_boy
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "django-silk";
|
||||
version = "3.0.2";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "8dd5b78531360bd8c3d571384f9f4f82ef03e1764e30dd4621c5638f5c973a1d";
|
||||
# pypi tarball doesn't include test project
|
||||
src = fetchFromGitHub {
|
||||
owner = "jazzband";
|
||||
repo = "django-silk";
|
||||
rev = version;
|
||||
sha256 = "1fbaafc2gx01gscdalp6hj6bz4b0cmq59lgmvsydw7jkds4mps7c";
|
||||
};
|
||||
|
||||
doCheck = false;
|
||||
# "test_time_taken" tests aren't suitable for reproducible execution, but django's
|
||||
# test runner doesn't have an easy way to ignore tests - so instead prevent it from picking
|
||||
# them up as tests
|
||||
postPatch = ''
|
||||
substituteInPlace project/tests/test_silky_profiler.py \
|
||||
--replace "def test_time_taken" "def _test_time_taken"
|
||||
'';
|
||||
|
||||
buildInputs = [ mock ];
|
||||
propagatedBuildInputs = [
|
||||
|
@ -32,6 +46,11 @@ buildPythonPackage rec {
|
|||
sqlparse jinja2 autopep8 pytz pillow gprof2dot
|
||||
];
|
||||
|
||||
checkInputs = [ freezegun contextlib2 networkx pydot factory_boy ];
|
||||
checkPhase = ''
|
||||
cd project
|
||||
DB=sqlite3 DB_NAME=db.sqlite3 ${python.interpreter} manage.py test
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Silky smooth profiling for the Django Framework";
|
||||
|
|
Loading…
Reference in a new issue