madetech / souper-web-scraping

2 stars 1 forks source link

Increase test coverage #59

Closed HorstmannA closed 9 months ago

HorstmannA commented 9 months ago

Reading around the subject it seems that 70-80% coverage is ideal. Here is the current state:

% pre-commit run --all-files --verbose
run tests................................................................Passed
- hook id: tests
- duration: 1.97s

============================= test session starts ==============================
platform darwin -- Python 3.11.5, pytest-7.2.2, pluggy-1.3.0
rootdir: /Users/anna.horstmann/souper-web-scraping/backend, configfile: pytest.ini, testpaths: tests
plugins: anyio-4.0.0, md-report-0.3.0, mock-3.10.0, cov-4.0.0
collected 19 items                                                             

tests/test_create_report_model.py ....                                   [ 21%]
tests/test_feedback_reader.py .                                          [ 26%]
tests/test_get_report_links.py ...                                       [ 42%]
tests/test_get_reports.py ....                                           [ 63%]
tests/test_report_reader.py .                                            [ 68%]
tests/test_scrape_sections_html.py .....                                 [ 94%]
tests/test_section_reader.py .                                           [100%]

============================== 19 passed in 1.48s ==============================
HorstmannA commented 9 months ago

PR #68 makes the coverage:

% pre-commit run --all-files --verbose
run tests................................................................Passed
- hook id: tests
- duration: 2.01s

============================= test session starts ==============================
platform darwin -- Python 3.11.5, pytest-7.2.2, pluggy-1.3.0
rootdir: /Users/anna.horstmann/souper-web-scraping/backend, configfile: pytest.ini, testpaths: tests
plugins: anyio-4.0.0, md-report-0.3.0, mock-3.10.0, cov-4.0.0
collected 23 items                                                             

tests/test_basic_info_scraper.py ...............                         [ 65%]
tests/test_feedback_reader.py .                                          [ 69%]
tests/test_report_reader.py .                                            [ 73%]
tests/test_section_info_scraper_html.py .....                            [ 95%]
tests/test_section_reader.py .                                           [100%]

============================== 23 passed in 1.56s ==============================