Add test cases for dataclasses.#17909
Merged
Merged
Conversation
* Add test for repr output of field and dataclass params. * Add test for ValueError to be raised when both default and default_factory are passed.
ericvsmith
reviewed
Jan 8, 2020
| self.assertNotEqual(C(3), C(4, 10)) | ||
| self.assertNotEqual(C(3, 10), C(4, 10)) | ||
|
|
||
| def test_dataclass_params_repr(self): |
Member
There was a problem hiding this comment.
This is testing an internal implementation detail. I'm not sure that this should be directly tested.
Member
There was a problem hiding this comment.
I have no opinion about keeping the test or not. But if you want to keep it, add @cpython_only decorator.
Member
Author
There was a problem hiding this comment.
I have removed the test. I am not sure of a better way to access it publicly.
Contributor
|
Thanks @tirkarthi for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
|
@ericvsmith: Please replace |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2020
* Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed. (cherry picked from commit eef1b02) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
GH-17919 is a backport of this pull request to the 3.8 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2020
* Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed. (cherry picked from commit eef1b02) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
|
GH-17920 is a backport of this pull request to the 3.7 branch. |
miss-islington
added a commit
that referenced
this pull request
Jan 10, 2020
* Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed. (cherry picked from commit eef1b02) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Automerge-Triggered-By: @ericvsmith
miss-islington
added a commit
that referenced
this pull request
Jan 10, 2020
* Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed. (cherry picked from commit eef1b02) Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com> Automerge-Triggered-By: @ericvsmith
shihai1991
pushed a commit
to shihai1991/cpython
that referenced
this pull request
Jan 31, 2020
* Add test cases for dataclasses. * Add test for repr output of field. * Add test for ValueError to be raised when both default and default_factory are passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ValueErrorto be raised when both default and default_factory are passed to a field.Added missing coverage cases based on https://codecov.io/gh/python/cpython/src/2e6a8efa837410327b593dc83c57492253b1201e/Lib/dataclasses.py
Thanks