setUpClass does not run with HTMLTestrunner
Attempted to run a test scenario/Testcase using the setUpClass(cls) and tearDownClass python unittest methods.
Note: The same script works using setUp(self) and tearDown(self) method. However the setup/teardown is called at every test_ def.
When running with the setUpClass(cls) and tearDownClass the following error is produced, from what I believe is an error in the HTMLTestrunner.
"[error] AttributeError ( '_TestResult' object has no attribute 'outputBuffer' )
[error] --- Traceback --- error source first
line: module ( function ) statement
594: HTMLTestRunner ( complete_output ) AttributeError: '_TestResult' object h
s no attribute 'outputBuffer'
198: suite ( _addClassOrModu
b\HTMLTestRunne
100: suite ( run ) File "C:\Sikuli\
53, in _handleClassSetUp
678: HTMLTestRunner ( run ) File "C:\Sikuli\
", line 70, in __call__
[error] --- Traceback --- end --------------
"
Stuck at how to get the outputbuffer attribute triggered. I think I need to edit the complete_output and the addError def in the HTMLTestrunner however I am not sure what to edit.
Here is an example of the script I am attempting to run.
from sikuli import *
import os
import sys
import HTMLTestRunner
import time
import unittest
#import utils
import org.sikuli.
dir = "C:\Sikuli\
if not dir in sys.path: sys.path.
fp = file(os.
class TestcaseSetupSc
@classmethod
def setUpClass(
wait(2)
wait(1)
#def setUp(self):
#print "testing 123"
@classmethod
def tearDownClass(
#def tearDown(self):
#print "321 testing"
def test_step_01(self):
wait(7)
assert exists(
def test_step_02(self):
wait(3)
assert exists(
def test_step_
assert exists(
suite = unittest.
runner = HTMLTestRunner.
runner.run(suite)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: