[rhinstaller/blivet/pulls/133 master] Fix tests deprecation warnings in a backward compatible way

mulkieran installerbot-noreply at redhat.com
Fri May 29 13:11:31 UTC 2015


I just realized there is another consideration.

I 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.

The 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.

I 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. 
-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/133


More information about the anaconda-patches mailing list