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

Migrate the test suite to vcrpy #541

Merged
merged 28 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e4bd91a
Move the tests files to a new tests directory
Terseus Oct 29, 2022
3166493
Add pytest-recoding, configure the repo to ignore generated YAML files
Terseus Oct 29, 2022
b7c041f
Migrate test_get_data to vcr
Terseus Oct 29, 2022
db3f88e
Migrate test_build_payload to vcr
Terseus Oct 29, 2022
150027d
Migrate test_tokens to vcr
Terseus Oct 29, 2022
52e446f
Migrate test_interest_over_time to vcr
Terseus Oct 29, 2022
53aae3a
Migrate test_interest_over_time_images to vcr
Terseus Oct 29, 2022
152425a
Add coverage report support, show it in pipeline
Terseus Oct 29, 2022
72da6fa
Migrate test_over_time_news to vcr, reduce tests boilerplate
Terseus Oct 29, 2022
abbad88
Migrate test_interest_over_time_youtube to vcr
Terseus Oct 30, 2022
557c5dd
Migrate test_interest_over_time_froogle to vcr
Terseus Oct 30, 2022
4931040
Migrate test_interest_over_time_bad_gprop to vcr
Terseus Oct 30, 2022
8c15afc
Migrate test_interest_by_region to vcr
Terseus Oct 30, 2022
4d14bd4
Migrate test_interest_by_region_city_resolution to vcr
Terseus Oct 30, 2022
351f770
Migrate test_related_topics to vcr, split it in 3 tests
Terseus Oct 30, 2022
b743c17
Migrate test_related_queries to vcr splitted in 3 tests
Terseus Oct 30, 2022
8117278
Migrate test_trending_searches to vcr, remove useless build_payload
Terseus Oct 30, 2022
6a40561
Migrate test_realtime_trending_searches to vcr
Terseus Oct 30, 2022
673e468
Remove useless index creations to reduce boilerplate
Terseus Oct 30, 2022
e1ec297
Migrate test_top_charts to vcr
Terseus Oct 30, 2022
5327811
Migrate test_suggestions to vcr
Terseus Oct 30, 2022
11f5baa
Migrate request_args passing tests to respones
Terseus Oct 30, 2022
41b8b7f
Remove the two leftover tests about the isPartial dtype
Terseus Oct 30, 2022
e7bd5c4
Add test_interest_over_time_partial to test when isPartial=True
Terseus Oct 30, 2022
0aeb371
Block network calls in CI
Terseus Oct 30, 2022
263e60f
Review some of the coverage config
Terseus Oct 30, 2022
146937e
Reduce some tests size by using a timeframe of 5 days
Terseus Oct 30, 2022
17b7f4d
Fix CI pytest execution
Terseus Oct 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/cassettes/**/*.yaml binary
tests/cassettes/**/*.yaml linguist-vendored
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
pytest --block-network --cov-report term
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,20 @@ keywords = [
]
dynamic = ["readme"]

[tool.setuptools]
packages = ["pytrends"]

# Taken from https://github.com/pypa/setuptools/blob/d138ec08efc2dbaebb8752e215e324f38bd807a2/setuptools/tests/config/test_pyprojecttoml.py#L68
[tool.setuptools.dynamic.readme]
file = ["README.md"]
content-type = "text/markdown"

[tool.coverage.run]
branch = true

[tool.coverage.report]
precision = 2
show_missing = true

[tool.pytest.ini_options]
addopts = "--cov pytrends/"
185 changes: 0 additions & 185 deletions pytrends/test_trendReq.py

This file was deleted.

3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
flake8
responses
pytest
pytest-cov
pytest-recording
Empty file added tests/__init__.py
Empty file.
Loading