1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 django,
6 setuptools,
7 setuptools-scm,
8 django-configurations,
9 pytest,
10 pytestCheckHook,
11}:
12buildPythonPackage rec {
13 pname = "pytest-django";
14 version = "4.8.0";
15 pyproject = true;
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-XQVP4BHFbzsQ+Xj0Go77Llrfx+aA7zb7VxraHyR3nZA=";
20 };
21
22 nativeBuildInputs = [
23 setuptools
24 setuptools-scm
25 ];
26
27 buildInputs = [ pytest ];
28
29 propagatedBuildInputs = [ django ];
30
31 nativeCheckInputs = [
32 django-configurations
33 pytestCheckHook
34 ];
35
36 preCheck = ''
37 # bring pytest_django_test module into PYTHONPATH
38 export PYTHONPATH="$(pwd):$PYTHONPATH"
39
40 # test the lightweight sqlite flavor
41 export DJANGO_SETTINGS_MODULE="pytest_django_test.settings_sqlite"
42 '';
43
44 disabledTests = [
45 # AttributeError: type object 'TestLiveServer' has no attribute '_test_settings_before_run'
46 "test_settings_restored"
47 ];
48
49 __darwinAllowLocalNetworking = true;
50
51 meta = with lib; {
52 description = "py.test plugin for testing of Django applications";
53 homepage = "https://pytest-django.readthedocs.org/en/latest/";
54 license = licenses.bsd3;
55 };
56}