Merge lp:~jameinel/bzr/2.1.0b4-win32-test-imports into lp:bzr
Proposed by
John A Meinel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Martin Pool | ||||
Approved revision: | not available | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~jameinel/bzr/2.1.0b4-win32-test-imports | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
120 lines (+59/-11) 3 files modified
bzrlib/tests/__init__.py (+31/-0) bzrlib/tests/test_osutils.py (+12/-11) bzrlib/tests/test_selftest.py (+16/-0) |
||||
To merge this branch: | bzr merge lp:~jameinel/bzr/2.1.0b4-win32-test-imports | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pool | Needs Fixing | ||
Vincent Ladeuil | Approve | ||
Review via email: mp+15829@code.launchpad.net |
To post a comment you must log in.
This patch does 2 things:
1) Adds a trap around importing 'termios' since it doesn't exist on windows. This is the most important part, and could be done in a different way. tests._ ModuleFeature. We have a very common pattern of running tests based on whether a given module can be imported. (Think of all the compiled extension tests.) It seemed nicer to me to have the module be part of the Feature, so that you don't end up with:
2) Adds bzrlib.
self.requireFe ature(feature)
from foo import bar
Given that 'feature' is already doing 'from foo import bar' to test that the module is available.
I haven't updated lots of code paths to use _ModuleFeature, but that would certainly be a reasonable next step.