diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2013-09-27 18:35:15 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2013-09-27 18:35:15 +0100 |
commit | 0a3b1a065257109295f9322f5a7e199d157acfe6 (patch) | |
tree | 8f7a25d69fe3728d23bfe7b5bbaef0957bbf3184 /subdir/__init__.py | |
parent | d7b5706244fca58d8a2564ba6394cb460d2ca2c6 (diff) | |
download | python-coverage-test-runner-0a3b1a065257109295f9322f5a7e199d157acfe6.tar.gz |
Fix importing submodules with the same basenames
This patch fixes a bug in CoverageTestRunner.py, where submodules
with the same basenames were not loaded into separate module
objects. Because the module names passed to imp.load_module() were
the same, previously loaded modules would be reloaded in place,
causing different problems:
1. Imports of the affected modules in the test and tested code
would sometimes import a different module and cause
AttributeError exceptions when expected symbols were not
present in the imported module.
2. Sometimes, all but one of the imported modules would incorrectly
be considered to have zero test coverage.
Diffstat (limited to 'subdir/__init__.py')
-rw-r--r-- | subdir/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/subdir/__init__.py b/subdir/__init__.py new file mode 100644 index 0000000..cd02b72 --- /dev/null +++ b/subdir/__init__.py @@ -0,0 +1,2 @@ +import foo +import modules_with_same_names_but_different_symbols |