Updates:
        Status: Pending
        Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 840 by pekka.klarck: libdoc.py: is an actual import of dependencies really required?
http://code.google.com/p/robotframework/issues/detail?id=840

libdoc.py uses Robot's modules for importing the library and they import the whole test library module and thus also all the modules imported there. It would probably be possible to create stubs for missing modules automatically, but I'm not sure is that forth the effort due to problems listed below:

1) Simply stubbing non-found modules isn't enough if the library needs the module already when it is created:

    import mymodule

    class MyLibrary(mymodule.SubLibrary):
        def my_keyword(self):
            pass

2) Most often it only people developing the library create documentation for it. These people most likely have all the needed dependencies anyway.

3) You can easily stub modules in the library code if you want. For example like this:

    try:
        import mymodule
    except ImportError:
mymodule = None # support using libdoc.py when mymodule isn't installed

4) As you already wrote, it's also possible to stub the modules externally like you did.

5) Implementing a built-in solution is not a trivial task.


Because the fix has drawbacks and there are workarounds, the core development team is not going to implement this in the foreseeable future. Are you possibly interested to look at this yourself?

Reply via email to