-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
I am trying to use postgresql_proc with loading external SQL files, using relative paths, similarly to what is shown in your README. It seems to me that pytest-postgresql does not do anything about the paths, instead using the current working directory as it was when calling pytest. This is quite confusing.
My expectation was for the paths to the scripts to be relative to the file in which postgresql_proc is called.
One thing that could have caused an issue is that the files are outside the Python package. It's a monorepo with the SQL elsewhere.
I have found two workarounds:
- call
os.chdir(Path(__file__).parent)at the top ofconftest.py - prepend
Path(__file__).parentto the paths for all the SQL files
Metadata
Metadata
Assignees
Labels
No labels