-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use fixtures outside ./fixtures/
#2539
Comments
That sounds like an improvement, yeah. The code for the I would name it |
Thanks. I will start to work on that tomorrow. It should not take too much time. |
@abonander, I've started to do it https://github.com/runtime-machines/sqlx/blob/2539-expand-fixtures/sqlx-macros-core/src/test_attr.rs . I think it is better to accept only one between Another possibility is:
|
Is your feature request related to a problem? Please describe.
In big projects, with a lot of integration tests, it happens that the same fixture needs to be used in multiple tests which are structured in sub folders, leading to duplicated
./fixtures/
files.Describe the solution you'd like
It would be nice to have the possibility to specify a path to the fixture script (e.g.,
../fixtures/users
), other than the name of the fixture script (as it is now), leading to something like:#[sqlx::test(fixtures("../other_dir/fixtures/users", "posts"))]
.Describe alternatives you've considered
An alternative could be to accept also
fixtures_with_path
, e.g.#[sqlx::test(fixtures_with_path("../other_dir/fixtures/users"), fixtures("posts"))]
.Additional context
None.
I would like to help on that one, if needed ofc.
The text was updated successfully, but these errors were encountered: