[py.test]: test dependencies

I am writing a test system using py.test, and am looking for a way to run specific tests depending on some test run results.

For example, we have a standard test class:

import pytest

class Test_Smoke:
   def test_A(self):
       pass

   def test_B(self):
       pass

   def test_C(self):
       pass

test_C () must be executed if the tags test_A () and test_B () were tested, otherwise they are omitted.

I need a way to do something like this at the test or test level of the class (for example, Test_Perfo is executed if all Test_Smoke passed), and I cannot find a solution using standard methods (for example, @ pytest.mark.skipif).

Is it even possible with pytest?

+6
source share
2 answers
+6

, pytest-. , , - .

+4

All Articles