Skip to content

Fix #244: Allow list & str for comparison #245

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

Merged

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Apr 26, 2020

This PR fixes #244 and contains the following changes:

The VersionInfo.compare method allows already VersionInfo, dict, tuple/list and str.

  • Extend list of allowed types in comparator with list and str.
  • Rewrite case test_should_not_allow_to_compare_version_with_string ->
    test_should_compare_version_string
  • Add new test cases:
    • test_should_compare_version_list
    • test_should_not_allow_to_compare_invalid_versionstring
  • Use pytest.mark.parametrize for test_should_compare_version_tuples
  • Update usage.rst to document all possibilities
  • Update CHANGELOG

@tomschr tomschr added the Bug Error, flaw or fault to produce incorrect or unexpected results label Apr 26, 2020
@tomschr tomschr requested a review from a team April 26, 2020 20:56
@tomschr tomschr self-assigned this Apr 26, 2020
@tomschr tomschr force-pushed the bugfix/244-missing-list-and-str branch from b5bc47a to f5a0aa4 Compare April 26, 2020 21:10
The VersionInfo.compare method allows already VersionInfo, dict,
tuple/list and str.

* Extend list of allowed types in comparator with list and str.
* Rewrite case test_should_not_allow_to_compare_version_with_string ->
  test_should_compare_version_string
* Add new test cases:
  - test_should_compare_version_list
  - test_should_not_allow_to_compare_invalid_versionstring
* Use pytest.mark.parametrize for test_should_compare_version_tuples
* Update usage.rst to document all possibilities
* Update CHANGELOG
@tomschr tomschr force-pushed the bugfix/244-missing-list-and-str branch from f5a0aa4 to 7057dc5 Compare April 26, 2020 21:15
@tomschr
Copy link
Member Author

tomschr commented May 1, 2020

@scls19fr any concerns with this PR? If not, I'd merge it on Saturday Tuesday to prepare for the release.

@tomschr tomschr merged commit 22ff5af into python-semver:master May 5, 2020
@tomschr tomschr deleted the bugfix/244-missing-list-and-str branch May 5, 2020 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error, flaw or fault to produce incorrect or unexpected results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot compare with list or string
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy