Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd test cases for dataclasses. #17909
Merged
+19
−0
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.
Lib/test/test_dataclasses.py
Outdated
@@ -479,6 +498,18 @@ class C: | |||
self.assertNotEqual(C(3), C(4, 10)) | |||
self.assertNotEqual(C(3, 10), C(4, 10)) | |||
|
|||
def test_dataclass_params_repr(self): |
This comment has been minimized.
This comment has been minimized.
ericvsmith
Jan 8, 2020
Member
This is testing an internal implementation detail. I'm not sure that this should be directly tested.
This comment has been minimized.
This comment has been minimized.
vstinner
Jan 8, 2020
Member
I have no opinion about keeping the test or not. But if you want to keep it, add @cpython_only
decorator.
This comment has been minimized.
This comment has been minimized.
tirkarthi
Jan 9, 2020
Author
Contributor
I have removed the test. I am not sure of a better way to access it publicly.
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Jan 9, 2020
Thanks @tirkarthi for the PR, and @ericvsmith for merging it |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 9, 2020
@ericvsmith: Please replace |
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2020
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 9, 2020
GH-17919 is a backport of this pull request to the 3.8 branch. |
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Jan 9, 2020
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 9, 2020
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
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.
tirkarthi commentedJan 8, 2020
ValueError
to 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