question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestCase for CodeBuilder.defaults property

See original GitHub issue

It 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:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Fatal1tycommented, Dec 12, 2019

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?

0reactions
blaggacaocommented, Dec 13, 2019

✔️

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found