Skip to content

Reduce test code duplication via supabase Client in pytest fixture #25

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

Merged
merged 3 commits into from
May 22, 2021

Conversation

olirice
Copy link
Contributor

@olirice olirice commented May 19, 2021

What kind of change does this PR introduce?

The test suite has some minor setup duplication at the top of each function. Namely,

url: str = os.environ.get("SUPABASE_TEST_URL")
key: str = os.environ.get("SUPABASE_TEST_KEY")
supabase: Client = create_client(url, key)

This change factors that test setup into a pytest fixture that is created once and shared across the tests that require a supabase.Client.

@J0
Copy link
Contributor

J0 commented May 22, 2021

Hey @olirice ,

Thank you for your contribution! This is helpful and will save us time looking through the duplicated sections of test code. Can we check if there are further changes that you'd like to make? Think we can review and subsequently merge otherwise

@olirice
Copy link
Contributor Author

olirice commented May 22, 2021

Hi @J0

This was the only immediate change I had on the test suite
There is also #26 (if there is interest in that change) but that belong in a separate PR

@J0
Copy link
Contributor

J0 commented May 22, 2021

Cool, thanks!

@J0 J0 merged commit 873b85b into supabase:develop May 22, 2021
@olirice olirice deleted the client_in_fixture branch May 23, 2021 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants