-
Notifications
You must be signed in to change notification settings - Fork 3
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
Tests for permissions and more #37
Conversation
db.connect() | ||
db.create_tables(MODELS) | ||
def database(database_maker): | ||
return database_maker(models=MODELS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this database_maker
to be a fixture?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically speaking, we don't need anything to be fixture-decorated but since that's the recommended pytest
way, why not following it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know pytest
recommends this way. I actually don't see why we should have a fixture if it's not used as a fixture (for tests).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second (third actually) thought, I think it's best that we keep it as a fixture. Reasons are:
- Its friend,
http_client_maker()
follows the same pattern and it must be a fixture so that it receives theaiohttp_client
fixture injection. - We shouldn't force testers to always create an intermediate fixture so that they can use
database_maker
. It should be usable directly as a fixture itself, being invoked as a db factory inside the test.
No description provided.