TestCase for CodeBuilder.defaults property
See original GitHub issueIt seems to me as if the defaults
property of the CodeBuilder
is nurtured by
self.cls.__dict__
(via namepsace
property).
If I look at an actual class I got:
cls.__dataclass_fields__
holding a mapping from field names to dataclass Field instances, which in turn has either a default
or a default_factory
.
Maybe the default property should read values from the cls.__dataclass_fields__
just as normally instanciated dataclass? (or at least not raise a MissingError, as cls(**kwargs)
would fill them in afterwards, and only break if default is a NoneType
)
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Improve Tests with the Builder Pattern for Test Data | Blog
There tests to confirm that if any given property were null, ... (but more code) builder pattern approach shown later in this article....
Read more >Writing a Test Case Generator for a Programming Language
Our test case generator will generate WebAssembly programs. ... This property, that generated inputs are always within the test domain, ...
Read more >Override default Spring-Boot application.properties settings in ...
This loads application.properties and then application-test.properties properties into application context for the test case, as per rules defined here.
Read more >unittest — Unit testing framework — Python 3.11.1 ...
This method will be used by default to compare dictionaries in calls to assertEqual() . New in version 3.1. Finally the TestCase provides...
Read more >A Quick Guide to @TestPropertySource - Baeldung
By default, the @TestPropertySource annotation tries to load a properties file relative to the class that declared the annotation. In this case, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi there. I managed to fix this in 1.11, so @blaggacao you don’t need to have a workaround anymore. Can you check if everything seems to be ok?
✔️