I have a small test script, which is normally run through nose.

It seems to have a problem when run under nose - it reaches out to a
database, when I'm attempting to tell it to skip that for the sake of
unit testing.  So I decided to run it under a debugger, to see why the
database code isn't getting monkey patched the way it's supposed to.

Toward that end, I modified the script enough (I thought!) to be able
to run it through pudb.  I did the if __name__ == '__main__' thing,
replaced a few self.assertEquals(a, b) with assert(a == b), changed
the parent class of the test class from unittest.TestCase to object,
etc.

If I run the script standalone (not through nose, not through pudb),
it seems to run just how I want it to.  It skips going to the
database, and all looks peachy.

If I run the script under pudb, it bombs out on an import that's doing
a module-level:
   INTERNAL_VERSION = pkg_resources.require("InfinityUnixHost")[0].version
I'm aware this is a bit weird
(https://pythonhosted.org/setuptools/pkg_resources.html#basic-workingset-methods),
but it sounds like we're kind of stuck with it.

Anyway, when this line (the "INTERNAL_VERSION =" one) is executed in
pudb, it tracebacks, saying it can't find InfinityUnixHost - and this
line is actually part of InfinityUnixHost. InfinityUnixHost is not pip
installed, but bootstrap.py seems to like it fine.  It's just when I
run it under pudb that I have this problem.

The exact error is:
    DistributionNotFound: The 'InfinityUnixHost' distribution was not
found and is required by
    the application

Does anyone have any guesses why this isn't working in pudb?

Thanks!

_______________________________________________
Pudb mailing list
[email protected]
https://lists.tiker.net/listinfo/pudb

Reply via email to