The Be() method does not allow a becauseArgsFunc parameter
See original GitHub issueDescription
The Be()
method should allow a becauseArgsFunc
parameter. This function callback creates and returns the becauseArgs
parameter list. This will improve performance of apps that use this method.
Example:
In my app, I need to create a large becauseArgs
parameter list. This is expensive. Especially since I assert in my inner most loop in my app, many times per second. This ends up slowing down my app significantly. I wish I could not evaluate becauseArgs
unless the assertion fails. So only if the assertion fails, will Be()
call the becauseArgsFunc
to get the actual becauseArgs
.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
c# - Can not use Func with parameters
I have an example for my problem. Basically i need to pass a method to another method with parameters included. public void test()...
Read more >Using Python Optional Arguments When Defining Functions
In this tutorial, you'll learn about Python optional arguments and how to define functions with default values. You'll also learn how to create...
Read more >Python args and kwargs: Demystified
my_sum() takes all the parameters that are provided in the input and packs them all into a single iterable object named args ....
Read more >The arguments object - JavaScript - MDN Web Docs - Mozilla
arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function.
Read more >5 Types of Arguments in Python Function Definitions
Learn about the five different types of arguments used in python function definitions: default, keyword, positional, arbitrary positional ...
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 FreeTop 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
Top GitHub Comments
We do some performance benchmarking on certain important operations like
BeEquivalentTo
. But for the rest, unless somebody complains, we don’t.In your case, the ask would be a big investment that we’re not willing to make right now.
Sure you can, but it wasn’t designed for that, so it may have consequences on the performance.