Tests using python-mock are brittle
Bug #807360 reported by
Muharem Hrnjadovic
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
High
|
Anton Gritsay |
Bug Description
When the signature of a mocked function changes for example the tests will not break. We should revisit all tests and make use of http://
Changed in openquake: | |
milestone: | none → 0.4.3 |
Changed in openquake: | |
assignee: | nobody → Anton Gritsay (angri) |
Changed in openquake: | |
status: | Confirmed → In Progress |
Changed in openquake: | |
status: | In Progress → Fix Committed |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
$ find tests -name \*.py | xargs grep -i patch db_utils_ unittest. py: with mock.patch( 'sqlalchemy. create_ engine' ) as ce_mock: db_utils_ unittest. py: with mock.patch( 'sqlalchemy. orm.sessionmake r') as sm_mock: db_utils_ unittest. py: with mock.patch( 'sqlalchemy. create_ engine' ) as ce_mock: db_utils_ unittest. py: with mock.patch( 'sqlalchemy. orm.sessionmake r') as sm_mock: unittest. py: with mock.patch( 'redis. client. Redis.delete' ) as delete_mock: dbmaint_ unittest. py: with mock.patch( 'tools. dbmaint. psql') as mock_psql: dbmaint_ unittest. py: with mock.patch( 'tools. dbmaint. psql') as mock_psql: gc_unittest. py: with mock.patch( 'openquake. kvs.cache_ gc') as gc_mock:
tests/alchemy_
tests/alchemy_
tests/alchemy_
tests/alchemy_
tests/kvs_
tests/tools_
tests/tools_
tests/cache_