···393393 def foo_running():
394394 machine.succeed("pgrep -x foo")
395395 ```
396396+397397+## Adding Python packages to the test script {#ssec-python-packages-in-test-script}
398398+399399+When additional Python libraries are required in the test script, they can be
400400+added using the parameter `extraPythonPackages`. For example, you could add
401401+`numpy` like this:
402402+403403+```nix
404404+import ./make-test-python.nix
405405+{
406406+ extraPythonPackages = p: [ p.numpy ];
407407+408408+ nodes = { };
409409+410410+ testScript = ''
411411+ import numpy as np
412412+ assert str(np.zeros(4) == "array([0., 0., 0., 0.])")
413413+ '';
414414+}
415415+```
416416+417417+In that case, `numpy` is chosen from the generic `python3Packages`.
···665665```
666666</programlisting>
667667 </section>
668668+ <section xml:id="ssec-python-packages-in-test-script">
669669+ <title>Adding Python packages to the test script</title>
670670+ <para>
671671+ When additional Python libraries are required in the test script,
672672+ they can be added using the parameter
673673+ <literal>extraPythonPackages</literal>. For example, you could add
674674+ <literal>numpy</literal> like this:
675675+ </para>
676676+ <programlisting language="bash">
677677+import ./make-test-python.nix
678678+{
679679+ extraPythonPackages = p: [ p.numpy ];
680680+681681+ nodes = { };
682682+683683+ testScript = ''
684684+ import numpy as np
685685+ assert str(np.zeros(4) == "array([0., 0., 0., 0.])")
686686+ '';
687687+}
688688+</programlisting>
689689+ <para>
690690+ In that case, <literal>numpy</literal> is chosen from the generic
691691+ <literal>python3Packages</literal>.
692692+ </para>
693693+ </section>
668694</section>