{"action":"created","issue":{"url":"https://api.github.com/repos/datalad/datalad/issues/45","labels_url":"https://api.github.com/repos/datalad/datalad/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/datalad/datalad/issues/45/comments","events_url":"https://api.github.com/repos/datalad/datalad/issues/45/events","html_url":"https://github.com/datalad/datalad/issues/45","id":58947177,"number":45,"title":"provide decorator to swallow log messages to get them ignored or analyzed","user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars.githubusercontent.com/u/39889?v=3","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-25T18:24:20Z","updated_at":"2015-02-26T04:18:57Z","closed_at":null,"body":"now if we run\r\n```\r\n$> nosetests -s -v datalad/tests/                 \r\ndatalad.tests.test_annexrepo.test_AnnexRepo_instance_brand_new ... ok\r\ndatalad.tests.test_annexrepo.test_AnnexRepo_instance_from_clone ... 2015-02-25 13:19:13,261 [ERROR  ] 'git clone -v /home/yoh/proj/datalad/datalad/datalad/tests/testrepos/basic/r1 /home/yoh/.tmp/tmptoMerM' returned with exit code 128\r\n| stderr: 'fatal: destination path '/home/yoh/.tmp/tmptoMerM' already exists and is not an empty directory.\r\n| ' (gitrepo.py:59)\r\nok\r\n...\r\n```\r\nwe get them spit out to the screen, which is not proper since they are intended to error out at that point (right @bpoldrack ?).  so we need to swallow them.\r\nIn fail2ban we have a derived TestCase class for that purpose: https://github.com/fail2ban/fail2ban/blob/HEAD/fail2ban/tests/utils.py#L200  which also allows to analyze those logs for testing (which we would need to).  But here we better come up with a decorator which captures and exposes within the test the logs.  Any takers? ;)"},"comment":{"url":"https://api.github.com/repos/datalad/datalad/issues/comments/76119932","html_url":"https://github.com/datalad/datalad/issues/45#issuecomment-76119932","issue_url":"https://api.github.com/repos/datalad/datalad/issues/45","id":76119932,"user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars.githubusercontent.com/u/39889?v=3","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T04:18:57Z","updated_at":"2015-02-26T04:18:57Z","body":"for 2.  just accept #46 pull request"}}