danielfm/unittest-xml-reporting — Issue #12: Doesn't handle 2.7 setUpClass()/tearDownClass()
Author: wilstoff
Created: 2012-01-25 16:56:45+00:00
State: open

When using xmlrunner with python 2.7's unittest framework, xmlrunner suppresses python errors in setUpClass() and tearDownClass() functions.
Running unittest framework with xmlrunner:

```python
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test_results'))
```

Output:

```
Running tests...
----------------------------------------------------------------------

======================================================================
Traceback (most recent call last):
File "./test_tpa.py", line 587, in
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test_results'))
File "/usr/lib/python2.7/unittest/main.py", line 95, in __init__
self.runTests()
File "/usr/lib/python2.7/unittest/main.py", line 229, in runTests
self.result = testRunner.run(self.test)
File "/usr/lib/python2.7/site-packages/xmlrunner/__init__.py", line 300, in run
result.printErrors()
File "/usr/lib/python2.7/unittest/runner.py", line 108, in printErrors
self.printErrorList('ERROR', self.errors)
File "/usr/lib/python2.7/site-packages/xmlrunner/__init__.py", line 122, in printErrorList
(flavour, test_info.get_elapsed_time(), \
File "/usr/lib/python2.7/site-packages/xmlrunner/__init__.py", line 33, in get_elapsed_time
return self.test_result.stop_time - self.test_result.start_time
AttributeError: '_XMLTestResult' object has no attribute 'stop_time'
```

Running without xmltestrunner:

```python
unittest.main()
```

Output:

```
E
======================================================================
ERROR: setUpClass (__main__.Test_TPA)
----------------------------------------------------------------------
Traceback (most recent call last):
File "./test_tpa.py", line 36, in setUpClass
blah.blah()
NameError: global name 'blah' is not defined

----------------------------------------------------------------------
Ran 0 tests in 0.000s

FAILED (errors=1)
```