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.

Add a pretend.ANY

See original GitHub issue

So with the call recorder it’s often a useful thing to be able to make a parameter that matches anything. Perhaps it’s a current timestamp or a random value, whatever it is you don’t know what it is.

Mock has mock.ANY and I’m finding myself installing mock just for mock.ANY.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alexcommented, May 30, 2015

So the necessary code is:

class _Any(object):
    def __eq__(self, other):
        return True

    def __ne__(self, other):
        return False

ANY = _Any()

I still feel pretty weird about this, call_recorder may have been a mistake.

0reactions
woodruffwcommented, Oct 13, 2022

Nope, I can just reuse that. My only thought was to have it in pretend since it’ll be used solely (in my case) with pretend’s other APIs, but that’s not a requirement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pretend User Guide
From Script to Screen. Pretend lets you tell your story. Pretend helps create and develop stories from writing to rough cut. You have...
Read more >
This Is the Part Where You Pretend to Add Value: A Dilbert ...
This Is the Part Where You Pretend to Add Value: A Dilbert Book (Volume 31) [Adams, Scott] on Amazon.com. *FREE* shipping on qualifying...
Read more >
My Pretend Home & Family 4+ - App Store
Play in the backyard pool, and hop into one of the fun floats! Have a BBQ and eat some food! Play with your...
Read more >
tk3369/Pretend.jl: Let's play pretend!
Pretend.activate() # Turn on the Pretend framework # Annotate any function with @mockable macro @mockable add(x, y) = x + y # Apply...
Read more >
Add Pretend Pets to Mom's Duties
“To me it's just like a job,” Ms. Selkow said. “I have to get in, take care of all their things, and I...
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