Merge lp:~msabramo/capturemock/tests into lp:capturemock
Status: | Needs review |
---|---|
Proposed branch: | lp:~msabramo/capturemock/tests |
Merge into: | lp:capturemock |
Diff against target: |
322 lines (+248/-0) 14 files modified
.bzrignore (+1/-0) setup.cfg (+21/-0) tests/capturemock/replay_thing.mock (+19/-0) tests/capturemock/requests_get.mock (+9/-0) tests/capturemock/sqlalchemy.mock (+13/-0) tests/capturemock/urllib2.mock (+13/-0) tests/cars.py (+17/-0) tests/test_cars.py (+16/-0) tests/test_requests.py (+24/-0) tests/test_sqlalchemy.py (+18/-0) tests/test_thing.py (+62/-0) tests/test_urllib2.py (+19/-0) tests/thing.py (+4/-0) tox.ini (+12/-0) |
To merge this branch: | bzr merge lp:~msabramo/capturemock/tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Geoff Bache | Pending | ||
Review via email: mp+197297@code.launchpad.net |
Description of the change
This branch adds some simple tests that work with py.test or nosetests.
It looks like you have been testing CaptureMock with your own tool, TextTest. I'm not very familiar with TextTest and had some trouble setting it up because of the Gtk dependency, so it seemed nice to have tests that work other test runners.
```
marca@marca-
...
marca@marca-
marca@marca-
...
marca@marca-
(venv)marca@
...
(venv)marca@
=======
platform darwin -- Python 2.7.2 -- pytest-2.4.2 -- /private/
collected 3 items
tests/test_cars.py <- capturemock/
tests/test_thing.py <- capturemock/
tests/test_
=======
(venv)marca@
test_cars.test_cars ... wheel.id = 1
wheel.id = 1
wheel.id = 1
wheel.id = 1
ok
test_thing.
test_thing.
-------
Ran 3 tests in 0.256s
OK
Unmerged revisions
- 4640. By Marc Abramowitz <email address hidden>
-
Add test of mocking sqlalchemy and pymssql
- 4639. By Marc Abramowitz <email address hidden>
-
Add setup.cfg so that you don't need to remember to run py.test with --assert=reinterp
- 4638. By Marc Abramowitz <email address hidden>
-
Add tests/capturemo
ck/requests_ get.mock - 4637. By Marc Abramowitz <email address hidden>
-
Enhance tests/test_
requests. py - 4636. By Marc Abramowitz <email address hidden>
-
Add a test that demonstrates replaying stuff from urllib2, urllib, and httplib
- 4635. By Marc Abramowitz <email address hidden>
-
Add support for tox
- 4634. By Marc Abramowitz <email address hidden>
-
Add tests that work with nosetests/py.test
Note that with py.test, the option `--assert=reinterp` is needed; otherwise it seems that some metaclass hackery that py.test assertion rewriting does conflicts with the metaclass hackery that CaptureMock does?