Permalink
Browse files

Added TravisCI testing

  • Loading branch information...
1 parent 794327a commit f12a9039c673b49ae59536396bd34a34454f7a04 Chris Rose committed Nov 24, 2012
Showing with 34 additions and 2 deletions.
  1. +31 −0 .travis.yml
  2. +2 −1 hamcrest_unit_test/core/issame_test.py
  3. +1 −1 setup.py
View
31 .travis.yml
@@ -0,0 +1,31 @@
+language: python
+
+python:
+ - 2.5
+ - 2.6
+ - 2.7
+ - 3.2
+ - pypy
+
+# matrix:
+# include:
+# - python: 2.5
+# - python: 2.6
+# - python: 2.7
+# - python: 3.2
+# env: LANG="en_US.utf-8"
+# - python: 3.2
+# env: LANG="C"
+
+install:
+ - mkdir testrun
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install --use-mirrors unittest2; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install --use-mirrors unittest2; fi
+ - pip install . --use-mirrors
+ - python setup.py build --build-lib=build/lib
+
+script:
+ # Must cd somewhere else so python3 doesn't get confused and run
+ # the python2 code from the current directory instead of the installed
+ # 2to3 version.
+ - nosetests -v -w build/lib hamcrest_unit_test
View
3 hamcrest_unit_test/core/issame_test.py
@@ -54,7 +54,8 @@ def testDescribeMismatch(self):
matcher.describe_mismatch('hi', description)
expected = re.compile("was 0x[0-9a-fA-F]+ 'hi'")
- self.assertTrue(expected.match(str(description)))
+ self.assertTrue(expected.match(str(description)),
+ "Expected %s to match %s" % (str(matcher), str(description)))
def testDescribeMismatchWithNilShouldNotIncludeAddress(self):
self.assert_describe_mismatch("was <None>", same_instance('foo'), None)
View
2 setup.py
@@ -42,7 +42,7 @@ def read(fname):
url = 'http://code.google.com/p/hamcrest/',
download_url = 'http://pypi.python.org/packages/source/P/PyHamcrest/PyHamcrest-%s.tar.gz' % __version__,
packages = find_packages(),
- test_suite = 'hamcrest-unit-test.alltests',
+ test_suite = 'hamcrest_unit_test.alltests',
provides = ['hamcrest'],
long_description=read('README.md'),
install_requires=['distribute'],

0 comments on commit f12a903

Please sign in to comment.