depot/third_party/nixpkgs/pkgs/development/python-modules/pytest-django/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

59 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
django,
setuptools,
setuptools-scm,
django-configurations,
pytest,
pytest-xdist,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pytest-django";
version = "4.8.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-XQVP4BHFbzsQ+Xj0Go77Llrfx+aA7zb7VxraHyR3nZA=";
};
build-system = [
setuptools
setuptools-scm
];
buildInputs = [ pytest ];
dependencies = [ django ];
nativeCheckInputs = [
django-configurations
pytest-xdist
pytestCheckHook
];
preCheck = ''
# bring pytest_django_test module into PYTHONPATH
export PYTHONPATH="$(pwd):$PYTHONPATH"
# test the lightweight sqlite flavor
export DJANGO_SETTINGS_MODULE="pytest_django_test.settings_sqlite"
'';
disabledTests = [
# AttributeError: type object 'TestLiveServer' has no attribute '_test_settings_before_run'
"test_settings_restored"
];
__darwinAllowLocalNetworking = true;
meta = with lib; {
changelog = "https://github.com/pytest-dev/pytest-django/blob/v${version}/docs/changelog.rst";
description = "Pytest plugin for testing of Django applications";
homepage = "https://pytest-django.readthedocs.org/en/latest/";
license = licenses.bsd3;
};
}