OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

[py.test]: test dependencies

  • Thread starter Thread starter Stanislaw Bobritsky
  • Start date Start date
S

Stanislaw Bobritsky

Guest
I'm writing test system using py.test, and looking for a way to make particular tests execution depending on some other test run results.

For example, we have standard test class:

Code:
import pytest

class Test_Smoke:
   def test_A(self):
       pass

   def test_B(self):
       pass

   def test_C(self):
       pass

test_C() should be executed if test_A() and test_B() were passed, else - skipped.

I need a way to do something like this on test or test class level (e.g. Test_Perfo executes, if all of Test_Smoke passed), and I'm unable to find a solution using standard methods (like @pytest.mark.skipif).

Is it possible at all with pytest?
<p>I'm writing test system using py.test, and looking for a way to make particular tests execution depending on some other test run results. </p>

<p>For example, we have standard test class:</p>

<pre><code>import pytest

class Test_Smoke:
def test_A(self):
pass

def test_B(self):
pass

def test_C(self):
pass
</code></pre>

<p>test_C() should be executed if test_A() and test_B() were passed, else - skipped.</p>

<p>I need a way to do something like this on test or test class level (e.g. Test_Perfo executes, if all of Test_Smoke passed), and I'm unable to find a solution using standard methods (like @pytest.mark.skipif).</p>

<p>Is it possible at all with pytest?</p>
 

Latest posts

Top