Replies: 1 comment 3 replies
-
This is a user error Monkey patching the config after you already used it to make the database is too late |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got the following code:
This file declares a singleton config object that reads various fields (stripped for sake of brevity here) including table-db-path.
Simple class that creates a connection to a sqlite3 database.
Simple test file that should checks that there's exactly one record in table.
Lastly, I try to patch the Config().table_db_path class property in conftest.py.
Conftest gets correctly loaded for other parameters, but this parameter strangely triggers
Error when pytest tries to discover tests, making said test not runnable. The strange thing is that if I check the value of Config().table_db_path, it's the unpatched value, instead of the patched one.
Does anyone have any clue on why this is happening?
Beta Was this translation helpful? Give feedback.
All reactions