How do I import a module one level above and use the most recent definitions?
Question: **tests.py**

    
    
    import unittest
    import sys
    import os
    sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
    import my_module.ext
    
    print sys.path
    print dir(my_module.ext)
    

But `dir` gives me the old functions. A month ago I `easy_install` an older
version, and when I run `python tests.py` I get all the old functions instead.

I need the new definitions which are currently living in `my_module.ext`

    
    
    ../
      - my_module/
          - __init__.py
          - ext.py
          - core.py
          - lib.py
      - tests
          - tests.py
    

Any idea how to achieve this? Thanks. The reason of not installing it is
because it's a good practice to run tests before deploying the library.

FYI, they are not classes. `my_module` can be built into an egg.


Answer: Try sys.path.insert(0, /path/to/module) rather than sys.path.append

