)]}'
{"tests/test_sql_upgrade.py":[{"author":{"_account_id":494,"name":"termie","email":"termie@openstack.org","username":"termie"},"change_message_id":"0998531d020728c16b3ce8bf3266119f33faad7f","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"# makes sure that a session is closed even if a test fails"},{"line_number":49,"context_line":"def use_session(fn):"},{"line_number":50,"context_line":"    def wraps(self, *args, **kwargs):"},{"line_number":51,"context_line":"        session \u003d self.Session()"},{"line_number":52,"context_line":"        try:"},{"line_number":53,"context_line":"            return fn(self, session, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FzWA%3D","line":50,"updated":"2013-04-22 21:00:03.000000000","message":"i\u0027m not sure whether the nose.tools covers this, but usually you do a @functools.wraps(fn) above this line","commit_id":"579c7a7568a870249297e830307c3d4b3182a1b7"},{"author":{"_account_id":494,"name":"termie","email":"termie@openstack.org","username":"termie"},"change_message_id":"0998531d020728c16b3ce8bf3266119f33faad7f","unresolved":false,"context_lines":[{"line_number":48,"context_line":"# makes sure that a session is closed even if a test fails"},{"line_number":49,"context_line":"def use_session(fn):"},{"line_number":50,"context_line":"    def wraps(self, *args, **kwargs):"},{"line_number":51,"context_line":"        session \u003d self.Session()"},{"line_number":52,"context_line":"        try:"},{"line_number":53,"context_line":"            return fn(self, session, *args, **kwargs)"},{"line_number":54,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FzVA%3D","line":51,"updated":"2013-04-22 21:00:03.000000000","message":"if we\u0027re doing self.Session() anyway, it seems viable that we can add the cleanup code to the default test teardowns, whenever self.Session() is called, add the session to a list of created sessions to be torn down at the end of the tests, then instead of putting a decorator around all these calls and adding an arg, you would just put session \u003d self.Session() at the beginning of each test using one","commit_id":"579c7a7568a870249297e830307c3d4b3182a1b7"},{"author":{"_account_id":494,"name":"termie","email":"termie@openstack.org","username":"termie"},"change_message_id":"0998531d020728c16b3ce8bf3266119f33faad7f","unresolved":false,"context_lines":[{"line_number":598,"context_line":"            \u0027user_project_metadata\u0027, self.metadata, autoload\u003dTrue)"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"        # Test user in project has role"},{"line_number":601,"context_line":"        r \u003d session.execute(\"select data from metadata where user_id\u003d\u0027%s\u0027\""},{"line_number":602,"context_line":"                            \" and tenant_id\u003d\u0027%s\u0027\" %"},{"line_number":603,"context_line":"                            (user[\u0027id\u0027], project[\u0027id\u0027]))"},{"line_number":604,"context_line":"        test_project1 \u003d json.loads(r.fetchone()[\u0027data\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FzV0%3D","line":601,"updated":"2013-04-22 21:00:03.000000000","message":"isn\u0027t there auto escaping if you use :1 or whatnot? we shouldn\u0027t be building our own sql strings this way.\n\nresult \u003d session.execute(\n            \"SELECT * FROM user WHERE id\u003d:param\",\n            {\"param\":5}\n        )\n\n we generally standardize on using single quotes, btw, so please don\u0027t switch these all","commit_id":"579c7a7568a870249297e830307c3d4b3182a1b7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"054855fbd91ff9b00088c798fb397cd0ec8a6549","unresolved":false,"context_lines":[{"line_number":598,"context_line":"            \u0027user_project_metadata\u0027, self.metadata, autoload\u003dTrue)"},{"line_number":599,"context_line":""},{"line_number":600,"context_line":"        # Test user in project has role"},{"line_number":601,"context_line":"        r \u003d session.execute(\"select data from metadata where user_id\u003d\u0027%s\u0027\""},{"line_number":602,"context_line":"                            \" and tenant_id\u003d\u0027%s\u0027\" %"},{"line_number":603,"context_line":"                            (user[\u0027id\u0027], project[\u0027id\u0027]))"},{"line_number":604,"context_line":"        test_project1 \u003d json.loads(r.fetchone()[\u0027data\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FyWQ%3D","line":601,"in_reply_to":"AAAAOn%2F%2FzV0%3D","updated":"2013-04-23 13:52:24.000000000","message":"Much agreed with above suggestion from Andy.","commit_id":"579c7a7568a870249297e830307c3d4b3182a1b7"}]}
