{"action":"created","issue":{"url":"https://api.github.com/repos/rhinstaller/blivet/issues/133","labels_url":"https://api.github.com/repos/rhinstaller/blivet/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/rhinstaller/blivet/issues/133/comments","events_url":"https://api.github.com/repos/rhinstaller/blivet/issues/133/events","html_url":"https://github.com/rhinstaller/blivet/pull/133","id":81404175,"number":133,"title":"Fix tests deprecation warnings in a backward compatible way","user":{"login":"atodorov","id":1002300,"avatar_url":"https://avatars.githubusercontent.com/u/1002300?v=3","gravatar_id":"","url":"https://api.github.com/users/atodorov","html_url":"https://github.com/atodorov","followers_url":"https://api.github.com/users/atodorov/followers","following_url":"https://api.github.com/users/atodorov/following{/other_user}","gists_url":"https://api.github.com/users/atodorov/gists{/gist_id}","starred_url":"https://api.github.com/users/atodorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atodorov/subscriptions","organizations_url":"https://api.github.com/users/atodorov/orgs","repos_url":"https://api.github.com/users/atodorov/repos","events_url":"https://api.github.com/users/atodorov/events{/privacy}","received_events_url":"https://api.github.com/users/atodorov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-05-27T11:10:14Z","updated_at":"2015-05-29T13:11:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rhinstaller/blivet/pulls/133","html_url":"https://github.com/rhinstaller/blivet/pull/133","diff_url":"https://github.com/rhinstaller/blivet/pull/133.diff","patch_url":"https://github.com/rhinstaller/blivet/pull/133.patch"},"body":"From the original review in PR #120\r\n\r\n@mulkieran\r\n> Please use \"with self.assertRaises\" everywhere. It's just easier on the eyes.\r\n\r\nThis doesn't work b/c assertRaises and assertRaisesRegex are different. I'm not quite sure what do you mean but directly changing one for the other doesn't seem to work.\r\n\r\n> Also, we always use six.PY2 and six.PY3 to check the python version for this kind of thing, not sys.version_info, so it's probably best to stick with that.\r\n\r\nFixed.\r\n\r\n> I think you should be able to avoid modifying the class hierarchy to deal with the versioning problem in commit 3. You might consider modifying unittest.TestCase instead, for example.\r\n\r\nLet me see how can I do this. Is there a place where I can hook into before the test cases are actually executed? If so I can monkey-patch unittest.TestCase instead of creating another base class."},"comment":{"url":"https://api.github.com/repos/rhinstaller/blivet/issues/comments/106799206","html_url":"https://github.com/rhinstaller/blivet/pull/133#issuecomment-106799206","issue_url":"https://api.github.com/repos/rhinstaller/blivet/issues/133","id":106799206,"user":{"login":"mulkieran","id":1218366,"avatar_url":"https://avatars.githubusercontent.com/u/1218366?v=3","gravatar_id":"","url":"https://api.github.com/users/mulkieran","html_url":"https://github.com/mulkieran","followers_url":"https://api.github.com/users/mulkieran/followers","following_url":"https://api.github.com/users/mulkieran/following{/other_user}","gists_url":"https://api.github.com/users/mulkieran/gists{/gist_id}","starred_url":"https://api.github.com/users/mulkieran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulkieran/subscriptions","organizations_url":"https://api.github.com/users/mulkieran/orgs","repos_url":"https://api.github.com/users/mulkieran/repos","events_url":"https://api.github.com/users/mulkieran/events{/privacy}","received_events_url":"https://api.github.com/users/mulkieran/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T13:11:31Z","updated_at":"2015-05-29T13:11:31Z","body":"I just realized there is another consideration.\r\n\r\nI think we should put a copy of that __init__.py file in every subdirectory of the test directory as well as at the top level.\r\n\r\nThe reason for this is that you might want to run your unittests more selectively, like only those from a subdirectory of tests. In that case, the top level ```__init__.py``` file may not be loaded. Or, you might want to run your tests with a more selective glob, and if the tests it finds occur only in a subdirectory that top-level ```__init__.py``` file might not be loaded.\r\n\r\nI believe that putting that ```__init__.py``` file in every subdirectory will ensure that the correct names are available whenever the tests are called via  the unittest discovery mechanism. And I believe that that code is idempotent, so duplicating it in the subdirectories should do no harm. "}}