diff options
author | Buck Golemon <buck@yelp.com> | 2014-11-14 14:00:27 -0800 |
---|---|---|
committer | Buck Golemon <buck@yelp.com> | 2014-11-14 14:00:27 -0800 |
commit | d05360a060187452f49302467f87ead09d27c9ba (patch) | |
tree | 9e82e20acb7358109ffd77de863088faf7a7c0eb /tests/test_files.py | |
parent | a3cb81edd6053a273447ba3821655320ed234a41 (diff) | |
download | python-coveragepy-git-d05360a060187452f49302467f87ead09d27c9ba.tar.gz |
ModuleFinder no longer takes a main-module argument.
--HG--
branch : __main__-support
extra : rebase_source : 3f4c29876960153907b65b6e8e818b8228ca4ec0
extra : histedit_source : 6567adaf9c89483b71501fd91e9d3c83ed3daec7%2C2c5c8a7af95b8b26af384b9a65815d077e4313ec
Diffstat (limited to 'tests/test_files.py')
-rw-r--r-- | tests/test_files.py | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index d72788c4..f6976a81 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -101,42 +101,15 @@ class MatcherTest(CoverageTest): ('yourmain', False), ] modules = ['test', 'py.test', 'mymain'] - for mm in ( - ModuleMatcher(modules), - ModuleMatcher(modules, main_module=None), - ModuleMatcher(modules, main_module='yourmain'), - ): - self.assertEqual( - mm.info(), - ['main_module=%r' % mm.main_module] + modules - ) - for modulename, matches in matches_to_try: - self.assertEqual( - mm.match(modulename), - modulename if matches else False, - modulename, - ) - - def test_module_matcher_dunder_main(self): - matches_to_try = [ - ('__main__', True), - ('mymain', True), - ('yourmain', False), - ] - modules = ['test', 'py.test', 'mymain'] - mm = ModuleMatcher(modules, main_module='mymain') - self.assertEqual(mm.info(), ["main_module='mymain'"] + modules) + mm = ModuleMatcher(modules) + self.assertEqual( + mm.info(), + modules + ) for modulename, matches in matches_to_try: - if not matches: - expected = False - elif modulename == '__main__': - expected = mm.main_module - else: - expected = modulename - self.assertEqual( mm.match(modulename), - expected, + matches, modulename, ) |