.. Copyright NTESS. See COPYRIGHT file for details.

   SPDX-License-Identifier: MIT

.. _tutorial-dependencies-multi:

Multiple dependencies
=====================

Tests can depend on more than one dependency, for example, the test ``blt`` depends on the ``bacon``, ``lettuce``, and ``tomato`` instance of ``ingredients``:

.. literalinclude:: /examples/depends_on/multi/ingredients.pyt
    :language: python

.. literalinclude:: /examples/depends_on/multi/blt.pyt
    :language: python

A graph of the dependency tree can be generated by ``canary find -g``:

.. command-output:: canary find -k 'not kitchen_sink' -g -r ./depends_on/multi
    :cwd: /examples
    :nocache:


Pattern matches
---------------

Glob patterns can be used to match multiple dependencies, as demonstrated in the ``kitchen_sink`` test case:

.. literalinclude:: /examples/depends_on/multi/kitchen_sink.pyt
    :language: python

A graph of the dependency tree can be generated by ``canary find -g``:

.. command-output:: canary find -k 'not green_eggs_and_ham and not blt' -g -r ./depends_on/multi
    :cwd: /examples
    :nocache:
