Skip to content
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

udpate test framework vcr cassettes #926

Merged
merged 2 commits into from
Sep 12, 2021

Conversation

lavigne958
Copy link
Collaborator

Update test framework and VCR

Update the test framework to use pytest.
Update the VCR library to use vcrpy.
Update contribution file and tox.ini files accordingly.

Using pytest allows the use of the library pytest-vcr
which records any interaction of test simply by
adding the annotation @pytest.mark.vcr on the test case.

Used fixtures to setup/clean test cases.
Each class uses a fixture to setup its client and create
the necessary spreadsheet. This fixture is called once per class.

The WorksheetTest class uses a second fixture to clear the spreadsheet
after each test.

Each test runs in a different instance of the class, we can't benefit
from the use of instance attribute, we must use class attribute to share
resources (like the gspread client and the spreadsheet and the sheet).

Fixtures can't be annotated with the @pytest.mark.vcr to record their
interactions, it must be done explicitly.

Updated the github action workflow to run the test suite and fail if
the test suite fails.

skip 2nd commit it only contains the test cassettes update.

closes #821
closes #923

Update the test framework to use `pytest`.
Update the VCR library to use `vcrpy`.
Update contribution file and `tox.ini` files accordingly.

Using `pytest` allows the use of the library `pytest-vcr`
which records any interrraction of test simply by
adding the annotation `@pytest.mark.vcr` on the test case.

Used fixtures to setup/clean test cases.
Each class uses a fixture to setup its client and create
the necessary spreadsheet. This fixture is called once per class.

The `WorksheetTest` class uses a second fixture to clear the spreadsheet
after each test.

Each test runs in a different instance of the class, we can't benefit
from the use of instance attribute, we must use class attribute to share
resources (like the gspread client and the spreadsheet and the sheet).

Fixtures can't be anotated with the `@pytest.mark.vcr` to record their
interrations, it must be done explicitly.

Updated the github action workflow to run the test suite and fail if
the test suite fails.
@lavigne958 lavigne958 requested a review from burnash September 8, 2021 19:12
@lavigne958 lavigne958 self-assigned this Sep 8, 2021
Copy link
Owner

@burnash burnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it :)

@lavigne958 lavigne958 merged commit e2a9241 into master Sep 12, 2021
@lavigne958 lavigne958 deleted the feature/udpate_test_framework_vcr_cassettes branch September 12, 2021 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update test suite using pytest Tests cassettes need to be updated
2 participants