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

refactor(tests): add helper function for tests #87

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

l-lumin
Copy link
Contributor

@l-lumin l-lumin commented Dec 17, 2024

Introduce a helper function validate_strings to streamline the validation of expected and excluded strings in test cases. Replace repetitive string assertions in the test_markitdown_local function with calls to this new helper, improving code readability and maintainability.

root@261c16c64651:/workspaces/markitdown# hatch test
========================================================================================================== test session starts ==========================================================================================================
platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0
rootdir: /workspaces/markitdown
configfile: pyproject.toml
plugins: rerunfailures-14.0, mock-3.14.0, xdist-3.6.1
collected 3 items                                                                                                                                                                                                                       

tests/test_markitdown.py ..s                                                                                                                                                                                                      [100%]

=========================================================================================================== warnings summary ============================================================================================================
../../root/.local/share/hatch/env/virtual/markitdown/2jxz10qj/hatch-test.py3.13/lib/python3.13/site-packages/speech_recognition/__init__.py:7
  /root/.local/share/hatch/env/virtual/markitdown/2jxz10qj/hatch-test.py3.13/lib/python3.13/site-packages/speech_recognition/__init__.py:7: DeprecationWarning: aifc was removed in Python 3.13. Please be aware that you are currently NOT using standard 'aifc', but instead a separately installed 'standard-aifc'.
    import aifc

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================================================== 2 passed, 1 skipped, 1 warning in 14.14s ================================================================================================
root@261c16c64651:/workspaces/markitdown# 

Introduce a helper function `validate_strings` to streamline the 
validation of expected and excluded strings in test cases. Replace 
repetitive string assertions in the `test_markitdown_local` function 
with calls to this new helper, improving code readability and 
maintainability.
@gagb
Copy link
Contributor

gagb commented Dec 20, 2024

Good catch. Thank you!

@gagb gagb requested a review from afourney December 20, 2024 19:37
@gagb gagb merged commit 52d7308 into microsoft:main Dec 20, 2024
2 checks passed
@l-lumin l-lumin deleted the refactor-tests branch December 21, 2024 02:29
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