0

I have several update functions. They must be executed in strict order.

For example

def update1(a1):
  do_something...

def update2(a1, a2):
  do_something...

def update3(a1):
  do_something...


def process(a,b):
  update1(a)
  update2(a,b)
  update3(a)

In process, all update functions must be executed in that order.

How to write a unit test to test the order of the executions inside process?


I am not asking the execution order of tests, not like these questions

Python unittest.TestCase execution order

Execution order on python unittest

0

1 Answer 1

3

Ask yourself the question, "why is the order important?" If you can't tell from outside the difference of calls, you don't have to test them. If these are for example database updates you have to write a database mockup which logs the order of updates, or make a select statement, that can check, if the updates ocured in the correct order.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.