Re: python unit test frame work

2015-12-12 Thread Peter Otten
Ganesh Pal wrote: > On Thu, Dec 10, 2015 at 9:20 PM, Peter Otten <__pete...@web.de> wrote: >> Ganesh Pal wrote: >> > >> I recommend that you reread the unittest documentation. >> >> setUpClass() should be a class method, and if it succeeds you can release >> the ressources it required in the corr

Re: python unit test frame work

2015-12-12 Thread Ganesh Pal
On Thu, Dec 10, 2015 at 9:20 PM, Peter Otten <__pete...@web.de> wrote: > Ganesh Pal wrote: > > I recommend that you reread the unittest documentation. > > setUpClass() should be a class method, and if it succeeds you can release > the ressources it required in the corresponding tearDownClass() met

Re: python unit test frame work

2015-12-10 Thread Cameron Simpson
On 11Dec2015 14:09, Ben Finney wrote: Cameron Simpson writes: First, as Ben remarks, if one test _depends_ on an earlier one then it isn't a real unit test. On the other hand, if you simply have some simple tests followed by more complex tests (I have several like this) you have two facilitie

Re: python unit test frame work

2015-12-10 Thread Ben Finney
Cameron Simpson writes: > First, as Ben remarks, if one test _depends_ on an earlier one then it > isn't a real unit test. > > On the other hand, if you simply have some simple tests followed by > more complex tests (I have several like this) you have two facilities > to help you. > > Firstly, I

Re: python unit test frame work

2015-12-10 Thread Cameron Simpson
On 11Dec2015 04:05, Ganesh Pal wrote: On Dec 11, 2015 3:57 AM, "Ganesh Pal" wrote: > Drop the habit to sprinkle sys.exit() all over the place. A well-behaved > application has one exit point, at the end of the main module. I was using sys.exit() as the means to stop the execution or termina

Re: python unit test frame work

2015-12-10 Thread Ben Finney
Ganesh Pal writes: > I have multiple checks if I don't meet them continuing with the main > program doesn't make sense That means these are not unit tests (which are isolatable, independent test cases). If the tests are best characterised as a sequence of steps, then the ‘unittest’ model (desig

Re: python unit test frame work

2015-12-10 Thread Ganesh Pal
+python list . sorry I accidentally did a reply to Peter. On Dec 11, 2015 3:57 AM, "Ganesh Pal" wrote: > > > > Drop the habit to sprinkle sys.exit() all over the place. A well-behaved > > application has one exit point, at the end of the main module. > I was using sys.exit() as the means to stop

Re: python unit test frame work

2015-12-10 Thread Peter Otten
Ganesh Pal wrote: > Hello Team, > > Iam on python 2.7 and linux. Iam trying to understand the python unit > test frame work and also trying to fix the below code , any help in > this regard would be appreciated ? I recommend that you reread the unittest documentation. setUpCl

python unit test frame work

2015-12-10 Thread Ganesh Pal
Hello Team, Iam on python 2.7 and linux. Iam trying to understand the python unit test frame work and also trying to fix the below code , any help in this regard would be appreciated ? # Sample code starts here inject_failure = {} report = "" ClassIsSetup = False Cl