Skip to content
Snippets Groups Projects
  • Vegard Nossum's avatar
    48f4c8db
    tests: use __file__ to determine library path · 48f4c8db
    Vegard Nossum authored
    By using `os.path.dirname(__file__)` you can run the test from any directory/cwd and it will find the right path to the sample module. Without it you might accidentally import it from the wrong directory (i.e. if you have a development version of your project checked out, but you also have one installed in the system path, you may think that your tests pass when in fact they were testing the system installation rather than the development version).
    48f4c8db
    History
    tests: use __file__ to determine library path
    Vegard Nossum authored
    By using `os.path.dirname(__file__)` you can run the test from any directory/cwd and it will find the right path to the sample module. Without it you might accidentally import it from the wrong directory (i.e. if you have a development version of your project checked out, but you also have one installed in the system path, you may think that your tests pass when in fact they were testing the system installation rather than the development version).
Code owners
Assign users and groups as approvers for specific file changes. Learn more.