~testtools-committers/testscenarios/trunk

« back to all changes in this revision

Viewing changes to README

  • Committer: Robert Collins
  • Date: 2015-05-04 00:12:16 UTC
  • Revision ID: robertc@robertcollins.net-20150504001216-ff26ybf0lrejmr2s
0.4
~~~

IMPROVEMENTS
------------

* Python 3.2 support added. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
``testscenarios.generate_scenarios()``. For instance::
99
99
 
100
100
  >>> import unittest
101
 
  >>> import StringIO
 
101
  >>> try:
 
102
  ...     from StringIO import StringIO
 
103
  ... except ImportError:
 
104
  ...     from io import StringIO
102
105
  >>> from testscenarios.scenarios import generate_scenarios
103
106
 
104
107
This can work with loaders and runners from the standard library, or possibly other
106
109
 
107
110
  >>> loader = unittest.TestLoader()
108
111
  >>> test_suite = unittest.TestSuite()
109
 
  >>> runner = unittest.TextTestRunner(stream=StringIO.StringIO())
 
112
  >>> runner = unittest.TextTestRunner(stream=StringIO())
110
113
 
111
114
  >>> mytests = loader.loadTestsFromNames(['doc.test_sample'])
112
115
  >>> test_suite.addTests(generate_scenarios(mytests))
211
214
  ...
212
215
  >>> suite2 = unittest.TestSuite()
213
216
  >>> suite2.addTests(generate_scenarios(suite))
214
 
  >>> print suite2.countTestCases()
 
217
  >>> print(suite2.countTestCases())
215
218
  4
216
219
 
217
220
Dynamic Scenarios