-
Notifications
You must be signed in to change notification settings - Fork 16
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
load DB from existing db file #658
Comments
You have |
i cant see that in the docs. how do i pass that to the factory? |
Then in your tests, use your configured |
that wont work. if you look at the code https://github.com/ClearcodeHQ/pytest-redis/blob/main/pytest_redis/factories/proc.py#L15 |
Maybe a solution for you is to copy your rdb file for the test, and to rename it to match |
No problem, thanks for trying
ill give that a try. im not sure it will work because i will need to start the fixture to get the filename and i dont know how well redis handles having its db file swapped out from under it but worth a try |
No, that's not supported at the moment. There's also a https://redis.io/learn/guides/import#import-using-redscli-script which could be triggered each time by the client fixture.... |
thanks ill look into these options
i didnt realise that. the library also has the abilaty to connect to an existing redis server, will that be wiped each test? (this was my backup plan although at that point im not sure this test fixture adds much over just using the standard library) |
yes, that's applied as well. I don't see any other means to provide same starting points between tests and tests not affecting other tests than that. |
in this case im testing database reads so it should be fine to not wipe it but i get why that is the sensible thing to do in most cases. i might just have to suck it up and stick a bunch of writes in the setup function |
hi, is there a way to have the factory load data from an existing DB file? that would be a much easier way to populate it with test data than having to use a bunch of set commands
The text was updated successfully, but these errors were encountered: