summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2023-01-03 14:28:23 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2023-01-03 18:00:31 +0100
commit83481b87082efe630b6bcd3c5089f488d90be51f (patch)
treeef6c3a2103ca3f0db04c661ef3f023dfb722d3e8
parent2628f0003c708c20191022dbe911002c17ec5203 (diff)
downloadnixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar.gz
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar.bz2
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar.lz
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar.xz
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.tar.zst
nixpkgs-83481b87082efe630b6bcd3c5089f488d90be51f.zip
doc: python: Run hooks in checkPhase
-rw-r--r--doc/languages-frameworks/python.section.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index ab5ba428958..2f15d0f0468 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -570,7 +570,13 @@ test run would be:
 
 ```
   checkInputs = [ pytest ];
-  checkPhase = "pytest";
+  checkPhase = ''
+    runHook preCheck
+
+    pytest
+
+    runHook postCheck
+  '';
 ```
 
 However, many repositories' test suites do not translate well to nix's build
@@ -582,7 +588,11 @@ To filter tests using pytest, one can do the following:
   checkInputs = [ pytest ];
   # avoid tests which need additional data or touch network
   checkPhase = ''
+    runHook preCheck
+
     pytest tests/ --ignore=tests/integration -k 'not download and not update'
+
+    runHook postCheck
   '';
 ```
 
@@ -1408,7 +1418,11 @@ example of such a situation is when `py.test` is used.
     # assumes the tests are located in tests
     checkInputs = [ pytest ];
     checkPhase = ''
+      runHook preCheck
+
       py.test -k 'not function_name and not other_function' tests
+
+      runHook postCheck
     '';
   }
   ```