Skip to content

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

Merged
tomschr merged 1 commit into
python-semver:masterfrom
tomschr:bugfix/244-missing-list-and-str
May 5, 2020
Merged

Fix #244: Allow list & str for comparison#245
tomschr merged 1 commit into
python-semver:masterfrom
tomschr:bugfix/244-missing-list-and-str

Conversation

@tomschr

@tomschr tomschr commented Apr 26, 2020

Copy link
Copy Markdown
Member

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

tomschr commented May 1, 2020

Copy link
Copy Markdown
Member Author

@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