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.

Alias _Call class?

See original GitHub issue

I am/was using code like the following to detect if some object is a _Call instance (to stop recursion in this case):

    from pytest_mock import mock_module

    try:
        _Call = mock_module.mock._Call
    except AttributeError:
        # unittest.mock
        _Call = mock_module._Call
    if isinstance(exp, _Call):
        ...

Since mock_module has been moved in https://github.com/pytest-dev/pytest-mock/commit/a4cfee7a0843a07e86a458a6c129893356c6b122, I wonder what is the best way to fix / address this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Nov 22, 2016

Don’t worry, I will handle it tomorrow and make a quick release, but thanks for the offer!

0reactions
blueyedcommented, Nov 22, 2016

Should I do a PR, or will you handle it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

make a class alias to call static methods - javascript
All you want to do is introduce another variable that holds the same class object: const Alias = TheClassThatIWantToAlias;.
Read more >
How to Use The Ruby Alias Keyword - RubyGuides
You can give an alternative name to a Ruby method in two ways: alias & alias_method. ... If you call a method on...
Read more >
What's the Most Pythonic Way to Alias Method Names? - Finxter
You can define your own alias method by adding the statement a = b to your class definition. This creates an alias method...
Read more >
Creating and Managing Class Aliases - MATLAB & Simulink
A class alias definition is a mapping of one or more old class names to a new ... Call the addAlias method on...
Read more >
LLVM Alias Analysis Infrastructure
Most importantly, the AliasAnalysis class provides several methods which are used to query whether or not two memory objects alias, whether function calls...
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