Deo python support setUp() and tearDown() acts differently depending on the context? By all means, I am asking about if I can do something like this:
setUp() {
if(context1){
do A;
}
else{
do B;
}
}
tearDown() {
if(context1){
do A;
}
else{
do B;
}
}
Yeah, and just like you show it: use if blocks and only do particular parts of the setup if the condition is true.
I think what you’re getting at is to have different versions of
setUpandtearDownfor different tests. I’d actually suggest that you either:setUp/tearDownmethodsor don’t use
setUpandtearDownat all – do something like this