From c85eef94d291b29a369d9054c45ea7ef703d902f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 8 Sep 2023 08:42:33 +0200 Subject: [PATCH] python310Packages.bimmer-connected: provide test responses in the package output, as home-assistant tests rely on them. Also enable more tests by providing pytest-asyncio. --- .../python-modules/bimmer-connected/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/python-modules/bimmer-connected/default.nix b/pkgs/development/python-modules/bimmer-connected/default.nix index baa4ddacfec5..57eb2dc26845 100644 --- a/pkgs/development/python-modules/bimmer-connected/default.nix +++ b/pkgs/development/python-modules/bimmer-connected/default.nix @@ -7,9 +7,12 @@ , httpx , pycryptodome , pyjwt +, pytest-asyncio , pytestCheckHook +, python , respx , time-machine +, tzdata }: buildPythonPackage rec { @@ -39,12 +42,21 @@ buildPythonPackage rec { pyjwt ]; + postInstall = '' + cp -R bimmer_connected/tests/responses $out/${python.sitePackages}/bimmer_connected/tests/ + ''; + nativeCheckInputs = [ + pytest-asyncio pytestCheckHook respx time-machine ]; + preCheck = '' + export TZDIR=${tzdata}/${python.sitePackages}/tzdata/zoneinfo + ''; + pythonImportsCheck = [ "bimmer_connected" ];