From 57d512a4e16a530bad6360ec62d6fee740dead27 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:37:20 +0200 Subject: [PATCH] Run Pytest in installed package in Nix test Somehow this sidesteps the problem of plugins from `conftest.py` not being available. --- .github/workflows/python-package.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a2d1e7b92..3c18a4507 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,7 +68,11 @@ jobs: python -m venv venv source venv/bin/activate pip install "${{needs.build-wheel.outputs.wheel-path}}[test]" - pytest + # Run tests in installed package to avoid plugin import issue: + pytest $(python -c " + import os, darker + print(os.path.dirname(darker.__file__)) + ") ' \ ./default.nix