Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use tox to run tests against multiple Python versions

  • Loading branch information...
commit dc5eb53ef8722f6234031ce0f0d6bb5c58009308 1 parent c2c0b3f
@nickstenning nickstenning authored
View
2  .gitignore
@@ -1,7 +1,7 @@
-/pyenv
/annotator.egg-info
/annotator.cfg
/.coverage
/cover
/dist
+/.tox
*.pyc
View
11 README.md
@@ -38,15 +38,22 @@ default. See the [Annotator documentation][4] for details.
## Running tests
-Simply run `python run_tests.py` to run the test suite
+We use `nosetests` to run tests. You can just `pip install nosetests mock` and
+then:
- $ python run_tests.py
+ $ nosetests
....................................................
----------------------------------------------------------------------
Ran 52 tests in 3.233s
OK
+Alternatively (and preferably), you should install [Tox][5], and then run
+`tox`. This will run the tests against multiple versions of Python (if you
+have them installed).
+
+[5]: http://tox.testrun.org/
+
Please [open an issue](annotator-store/issues) if you find that the tests
don't all pass on your machine, making sure to include the output of `pip
freeze`.
View
6 run_tests.py
@@ -1,6 +0,0 @@
-import nose
-
-if __name__ == '__main__':
- nose.run()
-
-
View
2  setup.py
@@ -6,8 +6,6 @@
'pyes==0.19.1',
'PyJWT==0.1.4',
'iso8601==0.1.4',
- 'nose==1.1.2',
- 'mock==0.8.0'
]
if sys.version_info < (2, 7):
View
2  tests/test_elasticsearch.py
@@ -67,7 +67,7 @@ def test_fetch(self, pyes_mock):
o = self.Model.fetch(123)
assert_equal(o['foo'], 'bar')
assert_equal(o['id'], 123)
- assert_is_instance(o, self.Model)
+ assert_true(isinstance(o, self.Model))
@patch('annotator.elasticsearch.pyes.ES')
def test_fetch_not_found(self, pyes_mock):
View
8 tox.ini
@@ -0,0 +1,8 @@
+[tox]
+envlist = py26, py27, pypy
+
+[testenv]
+deps =
+ nose
+ mock
+commands = nosetests []
Please sign in to comment.
Something went wrong with that request. Please try again.