1. Olemis Lang
  2. bloodhound-mq

Commits

Olemis Lang  committed cc3cd44

BH Multiproduct #695 : Upgrade deps to cope with

- Losing track of ticket count when creating tickets in multiple products
- Trac's better_twill not detecting test_* methods when dumping HTML on twill assertion error

  • Participants
  • Parent commits d9809f1
  • Branches t695_commit_ticket_update

Comments (0)

Files changed (3)

File series

View file
 t695/t695_r1529237_commit_ticket_update.tests.diff
 t695/t695_r1529237_commit_ticket_update.diff
 t695/t695_r1534486_commit_ticket_update_checklinks.diff
+t695/t695_r1545950_twill_write_html.diff
+t695/t695_r1545950_functester_mp_ticket_count.diff
 t695/t695_r1534486_commit_ticket_update.tests.func.diff
 #t387/t387_r1524640_no_r5994.diff

File t695/t695_r1545950_functester_mp_ticket_count.diff

View file
+# HG changeset patch
+# Parent 0a8b462219cd14732d1483d01e986d9a116d08d8
+BH Multiproduct #695 : Let functional tester cache per-product ticket count
+
+diff -r 0a8b462219cd bloodhound_multiproduct/tests/functional/__init__.py
+--- a/bloodhound_multiproduct/tests/functional/__init__.py	Sun Dec 08 17:25:33 2013 -0500
++++ b/bloodhound_multiproduct/tests/functional/__init__.py	Sun Dec 08 19:12:55 2013 -0500
+@@ -456,7 +456,7 @@
+         :param skiplogin:   Skip admin user login
+         """
+         self.url = url
+-        self._state = instance_state or dict(ticketcount=0)
++        self._state = instance_state or dict(ticketcount={})
+ 
+         # Connect, and login so we can run tests.
+         self.go_to_front()
+@@ -468,11 +468,13 @@
+         """Retrieve ticket count from shared instance state.
+         Ticket ID sequence is global.
+         """
+-        return self._state.get('ticketcount', 0)
++        ticketcount_cache = self._state.setdefault('ticketcount', {})
++        return ticketcount_cache.get(self.url, 0)
+ 
+     @ticketcount.setter
+     def ticketcount(self, value):
+-        self._state['ticketcount'] = value
++        ticketcount_cache = self._state.setdefault('ticketcount', {})
++        ticketcount_cache[self.url] = value
+ 
+     def login(self, username):
+         """Login as the given user

File t695/t695_r1545950_twill_write_html.diff

View file
+# HG changeset patch
+# Parent 929334e93e9bfef6e5f081b5992496caf005381c
+BH Trac #695 : Handle test_* methods in better_twill's twill_write_html
+
+diff -r 929334e93e9b trac/trac/tests/functional/better_twill.py
+--- a/trac/trac/tests/functional/better_twill.py	Sun Dec 08 16:58:24 2013 -0500
++++ b/trac/trac/tests/functional/better_twill.py	Sun Dec 08 17:22:07 2013 -0500
+@@ -120,9 +120,12 @@
+         """Write the current html to a file.  Name the file based on the
+         current testcase.
+         """
++        from unittest import TestCase
++
+         frame = sys._getframe()
+         while frame:
+-            if frame.f_code.co_name in ('runTest', 'setUp', 'tearDown'):
++            if frame.f_code.co_name in ('runTest', 'setUp', 'tearDown') \
++                    or isinstance(frame.f_locals.get('self'), TestCase):
+                 testcase = frame.f_locals['self']
+                 testname = testcase.__class__.__name__
+                 tracdir = testcase._testenv.tracdir