You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prompt Category:
Unit Testing
Prompt:
extract_data.py Create unit test cases for the file extract_data.py. Also implement Pylint for this file such that code is optimised, code smells are detected.
User Observation:
$ python3 -m pytest test_extract_data.py -v
================================================ test session starts ================================================
platform darwin -- Python 3.9.6, pytest-8.3.5, pluggy-1.5.0 -- /Library/Developer/CommandLineTools/usr/bin/python3
cachedir: .pytest_cache
rootdir: /Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3
plugins: cov-6.0.0
collected 3 items
test_extract_data.py::TestGoogleSheetExtraction::test_api_error PASSED [ 33%]
test_extract_data.py::TestGoogleSheetExtraction::test_empty_sheet PASSED [ 66%]
test_extract_data.py::TestGoogleSheetExtraction::test_successful_data_extraction PASSED [100%]
================================================= warnings summary ==================================================
test_extract_data.py:3
/Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3/test_extract_data.py:3: DeprecationWarning:
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at pandas-dev/pandas#54466
import pandas as pd
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================== 3 passed, 1 warning in 0.39s ============================================
$ python3 -m pytest test_extract_data.py -v
================================================ test session starts ================================================
platform darwin -- Python 3.9.6, pytest-8.3.5, pluggy-1.5.0 -- /Library/Developer/CommandLineTools/usr/bin/python3
cachedir: .pytest_cache
rootdir: /Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3
plugins: cov-6.0.0
collected 3 items
test_extract_data.py::TestGoogleSheetExtraction::test_api_error PASSED [ 33%]
test_extract_data.py::TestGoogleSheetExtraction::test_empty_sheet PASSED [ 66%]
test_extract_data.py::TestGoogleSheetExtraction::test_successful_data_extraction PASSED [100%]
================================================= warnings summary ==================================================
test_extract_data.py:3
/Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3/test_extract_data.py:3: DeprecationWarning:
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at pandas-dev/pandas#54466
import pandas as pd
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================================== 3 passed, 1 warning in 0.39s ============================================
$ python -m pytest test_extract_data.py --cov=extract_data
zsh: command not found: python
$ python3 -m pytest test_extract_data.py --cov=extract_data
================================================ test session starts ================================================
platform darwin -- Python 3.9.6, pytest-8.3.5, pluggy-1.5.0
rootdir: /Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3
plugins: cov-6.0.0
collected 3 items
test_extract_data.py ... [100%]
================================================= warnings summary ==================================================
test_extract_data.py:3
/Users/surya.sandeep.boda/Desktop/Marscode Zero to One 3/test_extract_data.py:3: DeprecationWarning:
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at pandas-dev/pandas#54466
import pandas as pd
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------- coverage: platform darwin, python 3.9.6-final-0 -----------
Name Stmts Miss Cover
-------------------------------------
extract_data.py 44 6 86%
-------------------------------------
TOTAL 44 6 86%
=========================================== 3 passed, 1 warning in 0.45s ============================================
Response ID:
cdc11218-5355-4cb3-ab05-3e5de03e1ced
0 commit comments