Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Commits on Nov 17, 2014
Show import error details.
When an import error happens ``testtools.run`` will now show the full
error rather than just the name of the module that failed to import.
(Robert Collins)

Change-Id: I2d9d7a4659b51a5e3ea8000301ecb799ed30f463
Commits on Nov 20, 2014
Release 1.5.0.
Change-Id: I9eb08db09551836593e4bb17dae8dde7d6e10848
Commits on Mar 09, 2015
Overhaul exception reporting.
unittest2 recently added the ability to show local variables in
tracebacks as #111
requested for us. Reusing that requires some refactoring of our code,
in particular where we were reimplementing bits of the traceback
module. Now we can just hard-depend on traceback2 and linecache2 which
are brought in by unittest2 1.0.0.

Change-Id: Ieb3268029d26b48ed4fcd25ed644bd339f6aa3fb
Release 1.6.0
Change-Id: I4dfc4e32a7f596b33f08aace89d62f3a57932d24
Opening 1.7.0 for development.
Change-Id: I27f9ecdf91f96d56cd569df22ecb0d61a35a3474
Commits on Mar 10, 2015
Bug #1430076 fix installing when extras is not installed.
Change-Id: Icc9c40d6ef74e6b12323fdab7ce0581ec68794b7
Open 1.7.0 again.
Change-Id: Icea5317965849ce598b7092f4a1770378a9f909e
Fix output of empty attachments.
Empty attachments to tests were triggering a file payload of None in the
``ExtendedToStreamDecorator`` code, which caused multiple copies of
attachments that had been output prior to the empty one.
(Robert Collins, #1378609)

Change-Id: I34a989546d57b245d4384b8c5b6d444e7ce0ac1b
Release 1.7.0
Change-Id: I5dac8b57f0843524f4abaaddfd5722471843cee8
Open next version.
Change-Id: I65f271385049506e790af5012e46a704a4f1635b
Fix building universal wheels on Python 3.
Building a wheel on Python 3 was missing ``_compat2x.py`` needed for Python2.
This was a side effect of the fix to bug #941958, where we fixed a cosmetic
error. (Robert Collins, #1430534)

This reverts commit 56c49a5.

Change-Id: I4de72a62b5ddf7349c432165f796841a0998e878
Commits on Mar 11, 2015
Fix pypy3 tests by using ceil when reporting duration.
During reporting in ``TextTestResult`` now always uses ``ceil`` rather than
depending on the undefined rounding behaviour in string formatting.
(Robert Collins)

Change-Id: I72e11ccd1c41e9dbc65358aba5c1ffdc2d96eaf6
Clamp Sphinx below 1.3 for travis on pypy3/3.2
Sphinx 1.3 seems to have a bad version check added, or something.
Fixes-Bug: #1430595

Change-Id: If340c22199ba03ba987cc4544aafce0473bbbfd4
Release 1.7.1
Change-Id: Ib9d553325041b3c4bc31a384fe3f2e784d7378ea
Open 1.8.0 for dev.
Change-Id: I39df70bcb249bdfca6ba563a862cdaf6da9ae951
Commits on Apr 02, 2015
Colin Watson
Rewind the deferred test log before attaching it.
Since the StringIO buffer is positioned at end-of-file after the
underlying test finishes, the twisted-log detail was previously always
empty.
Commits on Apr 03, 2015
Commits on Apr 04, 2015
Commits on Apr 07, 2015
Merge pull request #137 from cjwatson/deferredruntest-log
Rewind the deferred test log before attaching it.
Commits on May 04, 2015
Switch to pbr as a build system
This automates the manual dance around version numbers for less maintenance pain.

The main visible changes are:
- requirements are in requirements.txt for now
- tags must be just x.y.z not testtools-x.y.z
- version information in __init__ is dynamically looked up.
- we can probably cleanup a bunch of our bootstrap import glue but in
  the interest of clear reviews, and avoiding surprises, I'm leaving
  that alone for now.

Change-Id: Ia54f681b50764a94ada68a6b2ac1bc77bfb619c5
Release 1.8.0
Change-Id: I0a1db860a786d54addadb9d06eac470db6c430a4
View
@@ -16,3 +16,6 @@ doc/_build
testtools.egg-info
/build/
/.env/
+/.eggs/
+AUTHORS
+ChangeLog
View
@@ -6,20 +6,24 @@ python:
- "3.3"
- "3.4"
- "pypy"
- - "pypy3"
# We have to pin Jinja2 < 2.7 for Python 3.2 because 2.7 drops/breaks support:
# http://jinja.pocoo.org/docs/changelog/#version-2-7
+# And Spinx to < 1.3 for pypy3 and python 3.2 similarly.
#
# See also:
# http://stackoverflow.com/questions/18252804/syntax-error-in-jinja-2-library
matrix:
include:
- python: "3.2"
- env: JINJA_REQ="jinja2<2.7, Pygments<2.0"
+ env:
+ - JINJA_REQ="jinja2<2.7, Pygments<2.0"
+ - SPHINX="<1.3"
+ - python: "pypy3"
+ env: SPHINX="<1.3"
install:
- - pip install fixtures $JINJA_REQ sphinx
+ - pip install fixtures $JINJA_REQ sphinx$SPHINX
- python setup.py install
script:
View
@@ -4,7 +4,4 @@ include MANIFEST.in
include NEWS
include README.rst
include .gitignore
-graft doc
-graft doc/_static
-graft doc/_templates
prune doc/_build
View
72 NEWS
@@ -7,6 +7,78 @@ Changes and improvements to testtools_, grouped by release.
NEXT
~~~~
+1.8.0
+~~~~~
+
+Improvements
+------------
+
+* AsynchronousDeferredRunTest now correctly attaches the test log.
+ Previously it attached an empty file. (Colin Watson)
+
+1.7.1
+~~~~~
+
+Improvements
+------------
+
+* Building a wheel on Python 3 was missing ``_compat2x.py`` needed for Python2.
+ This was a side effect of the fix to bug #941958, where we fixed a cosmetic
+ error. (Robert Collins, #1430534)
+
+* During reporting in ``TextTestResult`` now always uses ``ceil`` rather than
+ depending on the undefined rounding behaviour in string formatting.
+ (Robert Collins)
+
+1.7.0
+~~~~~
+
+Improvements
+------------
+
+* Empty attachments to tests were triggering a file payload of None in the
+ ``ExtendedToStreamDecorator`` code, which caused multiple copies of
+ attachments that had been output prior to the empty one.
+ (Robert Collins, #1378609)
+
+1.6.1
+~~~~~
+
+Changes
+-------
+
+* Fix installing when ``extras`` is not already installed. Our guards
+ for the absence of unittest2 were not sufficient.
+ (Robert Collins, #1430076)
+
+1.6.0
+~~~~~
+
+Improvements
+------------
+
+* ``testtools.run`` now accepts ``--locals`` to show local variables
+ in tracebacks, which can be a significant aid in debugging. In doing
+ so we've removed the code reimplementing linecache and traceback by
+ using the new traceback2 and linecache2 packages.
+ (Robert Collins, github #111)
+
+Changes
+-------
+
+* ``testtools`` now depends on ``unittest2`` 1.0.0 which brings in a dependency
+ on ``traceback2`` and via it ``linecache2``. (Robert Collins)
+
+1.5.0
+~~~~~
+
+Improvements
+------------
+
+* When an import error happens ``testtools.run`` will now show the full
+ error rather than just the name of the module that failed to import.
+ (Robert Collins)
+
1.4.0
~~~~~
@@ -92,6 +92,13 @@ cause ``testtools.RunTest`` to fail the test case after the test has finished.
This is useful when you want to cause a test to fail, but don't want to
prevent the remainder of the test code from being executed.
+Exception formatting
+--------------------
+
+Testtools ``TestCase`` instances format their own exceptions. The attribute
+``__testtools_tb_locals__`` controls whether to include local variables in the
+formatted exceptions.
+
Test placeholders
=================
View
@@ -72,10 +72,12 @@ installed or have Python 2.7 or later, and then run::
$ python -m testtools.run discover packagecontainingtests
-For more information see the Python 2.7 unittest documentation, or::
+For more information see the Python unittest documentation, and::
python -m testtools.run --help
+which describes the options available to ``testtools.run``.
+
As your testing needs grow and evolve, you will probably want to use a more
sophisticated test runner. There are many of these for Python, and almost all
of them will happily run testtools tests. In particular:
View
@@ -169,20 +169,16 @@ Tasks
+++++
#. Choose a version number, say X.Y.Z
-#. In trunk, ensure __init__ has version ``(X, Y, Z, 'final', 0)``
#. Under NEXT in NEWS add a heading with the version number X.Y.Z.
#. Possibly write a blurb into NEWS.
#. Commit the changes.
-#. Tag the release, ``git tag -s testtools-X.Y.Z``
+#. Tag the release, ``git tag -s X.Y.Z -m "Releasing X.Y.Z"``
#. Run 'make release', this:
#. Creates a source distribution and uploads to PyPI
#. Ensures all Fix Committed bugs are in the release milestone
#. Makes a release on Launchpad and uploads the tarball
#. Marks all the Fix Committed bugs as Fix Released
#. Creates a new milestone
-#. Change __version__ in __init__.py to the probable next version.
- e.g. to ``(X, Y, Z+1, 'dev', 0)``.
-#. Commit 'Opening X.Y.Z+1 for development.'
#. If a new series has been created (e.g. 0.10.0), make the series on Launchpad.
#. Push trunk to Github, ``git push --tags origin master``
View
@@ -0,0 +1,7 @@
+pbr>=0.11
+extras
+# 'mimeparse' has not been uploaded by the maintainer with Python3 compat
+# but someone kindly uploaded a fixed version as 'python-mimeparse'.
+python-mimeparse
+unittest2>=1.0.0
+traceback2
View
@@ -1,7 +1,16 @@
-[test]
-test_module = testtools.tests
-buffer=1
-catch=1
+[metadata]
+name = testtools
+summary = Extensions to the Python standard library unit testing framework
+home-page = https://github.com/testing-cabal/testtools
+description-file = doc/overview.rst
+author = Jonathan M. Lange
+author-email = jml+testtools@mumak.net
+classifier =
+ License :: OSI Approved :: MIT License
+ Programming Language :: Python :: 3
+
+[files]
+packages = testtools
[bdist_wheel]
universal = 1
View
100 setup.py
@@ -1,92 +1,16 @@
#!/usr/bin/env python
-"""Distutils installer for testtools."""
+import setuptools
-from setuptools import setup
-from distutils.command.build_py import build_py
-import email
-import os
-import sys
+try:
+ import testtools
+ cmd_class = {}
+ if getattr(testtools, 'TestCommand', None) is not None:
+ cmd_class['test'] = testtools.TestCommand
+except:
+ cmd_class = None
-import testtools
-cmd_class = {}
-if getattr(testtools, 'TestCommand', None) is not None:
- cmd_class['test'] = testtools.TestCommand
-
-class testtools_build_py(build_py):
- def build_module(self, module, module_file, package):
- if sys.version_info >= (3,) and module == '_compat2x':
- return
- return build_py.build_module(self, module, module_file, package)
-cmd_class['build_py'] = testtools_build_py
-
-
-def get_version_from_pkg_info():
- """Get the version from PKG-INFO file if we can."""
- pkg_info_path = os.path.join(os.path.dirname(__file__), 'PKG-INFO')
- try:
- pkg_info_file = open(pkg_info_path, 'r')
- except (IOError, OSError):
- return None
- try:
- pkg_info = email.message_from_file(pkg_info_file)
- except email.MessageError:
- return None
- return pkg_info.get('Version', None)
-
-
-def get_version():
- """Return the version of testtools that we are building."""
- version = '.'.join(
- str(component) for component in testtools.__version__[0:3])
- phase = testtools.__version__[3]
- if phase == 'final':
- return version
- pkg_info_version = get_version_from_pkg_info()
- if pkg_info_version:
- return pkg_info_version
- # Apparently if we just say "snapshot" then distribute won't accept it
- # as satisfying versioned dependencies. This is a problem for the
- # daily build version.
- return "%s.0dev0" % (version,)
-
-
-def get_long_description():
- manual_path = os.path.join(
- os.path.dirname(__file__), 'doc/overview.rst')
- return open(manual_path).read()
-
-# Since we import testtools in setup.py, our setup requirements are our install
-# requirements.
-deps = [
- 'extras',
- # 'mimeparse' has not been uploaded by the maintainer with Python3 compat
- # but someone kindly uploaded a fixed version as 'python-mimeparse'.
- 'python-mimeparse',
- 'unittest2>=0.8.0',
- ]
-
-
-setup(name='testtools',
- author='Jonathan M. Lange',
- author_email='jml+testtools@mumak.net',
- url='https://github.com/testing-cabal/testtools',
- description=('Extensions to the Python standard library unit testing '
- 'framework'),
- long_description=get_long_description(),
- version=get_version(),
- classifiers=["License :: OSI Approved :: MIT License",
- "Programming Language :: Python :: 3",
- ],
- packages=[
- 'testtools',
- 'testtools.matchers',
- 'testtools.testresult',
- 'testtools.tests',
- 'testtools.tests.matchers',
- ],
- cmdclass=cmd_class,
- zip_safe=False,
- install_requires=deps,
- setup_requires=deps,
- )
+setuptools.setup(
+ cmdclass=cmd_class,
+ setup_requires=['pbr'],
+ pbr=True)
View
@@ -121,5 +121,7 @@
# established at this point, and setup.py will use a version of next-$(revno).
# If the releaselevel is 'final', then the tarball will be major.minor.micro.
# Otherwise it is major.minor.micro~$(revno).
-
-__version__ = (1, 4, 0, 'final', 0)
+from pbr.version import VersionInfo
+_version = VersionInfo('testtools')
+__version__ = _version.semantic_version().version_tuple()
+version = _version.release_string()
Oops, something went wrong.

No commit comments for this range