1 try:

2 from StringIO import StringIO

3 except ImportError:

4 from io import StringIO

5

6

7 StringIO # pyflakes, this is for re-export

8

9

10 class SessionWrapper:

11 def __init__(self, session):

12 self._session = session

13 if hasattr(session, 'testsfailed'):

14 self._attr = 'testsfailed'

15 else:

16 self._attr = '_testsfailed'

17

18 @property

19 def testsfailed(self):

20 return getattr(self._session, self._attr)

21

22 @testsfailed.setter

23 def testsfailed(self, value):

24 setattr(self._session, self._attr, value)