1

consider an example where I have 3 tests

def test_a():
   pass

def test_b():
   pass

def test_c():
   pass

now there is a plugin 'dependency' which creates execution dependency. But this is not what I am looking for. What I am trying to achieve is following

def test_a():
   pass

def test_b():
   pass

@pytest...[ some way to say that always execute test_a and test_b before 
            executing test_c ]
def test_c():
   pass

with this i can always have test_a and test_b executed even if i e.g. I invoke pytest as following

pytest -k test_c
Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
vk-code
  • 950
  • 12
  • 22
  • https://stackoverflow.com/q/17571438/2988730. The plugin you are referring to was written as a result of this question: https://stackoverflow.com/a/22468705/2988730 – Mad Physicist Nov 01 '18 at 14:44
  • @MadPhysicist this is not what I am looking for. I want to mandate execution of test_a and test_b if pytest chooses (based on various parameters) to run test_c. I tried the plugin and it does not do that. – vk-code Nov 01 '18 at 14:51
  • I am not claiming that it is a duplicate by any means, just that it is tangentially related to your question. I'm very curious about how to solve this too, but reading the other question leads me to believe that you would have to implement the equivalent of portions of that plugin. – Mad Physicist Nov 01 '18 at 14:52
  • Sorry didn't want to be rude, apologies. The plugin you suggested is very close to what i am asking. may be a new parameter to tweak it. – vk-code Nov 01 '18 at 14:59
  • No worries, I did not take your comment as rudeness at all. I also just realized that pytest-order is not what you want. pytest-dependency is in fact the way to go. It may be a little more complicated than your requirements, but you will have to implement something similar from scratch if you want to get similar functionality. – Mad Physicist Nov 01 '18 at 15:03

0 Answers0