the_transporter
Limp Gawd
- Joined
- Aug 19, 2004
- Messages
- 223
I created a class (i.e. results.py) that generates a HTML file based on the results produced by a test class, say test.py
Every time a test method is run in test.py, it will add the test method name to a pass or fail list (depending on the result) in generate.py
The only problem I have is that every time a test method is run in test.py, it will create a new instance of generate.py. So essentially the final HTML file that is created only contains the results of the last run test. I am having trouble getting all the test cases to use the same instance of generate.py.
Any idea on how to avoid this problem? What would be the correct way to implement some notion of global in the test.py?
Thank you
Every time a test method is run in test.py, it will add the test method name to a pass or fail list (depending on the result) in generate.py
The only problem I have is that every time a test method is run in test.py, it will create a new instance of generate.py. So essentially the final HTML file that is created only contains the results of the last run test. I am having trouble getting all the test cases to use the same instance of generate.py.
Any idea on how to avoid this problem? What would be the correct way to implement some notion of global in the test.py?
Thank you