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.

Tests fail with 1.11.2

See original GitHub issue

After upgrading to 1.11.2, my tests using pytest-mock start failing with the message below. It turns out this change fixes it but it still needs to be released.

I am using pytest 5.2.4

self = <pytest_mock.plugin.MockFixture._Patcher object at 0x104e8c590>
stack = [FrameInfo(frame=<frame at 0x104cfc5c0, file '/Users/powerjo/.local/share/virtualenvs/backend-qQJPOvQO/lib/python3.7/s...92, function='_hookexec', code_context=['        return self._inner_hookexec(hook, methods, kwargs)\n'], index=0), ...]

    def _enforce_no_with_context(self, stack):
        """raises a ValueError if mocker is used in a with context"""
        caller = stack[1]
        frame = caller[0]
        info = inspect.getframeinfo(frame)
>       code_context = " ".join(info.code_context).strip()
E       TypeError: can only join an iterable

../../../../.local/share/virtualenvs/backend-qQJPOvQO/lib/python3.7/site-packages/pytest_mock/plugin.py:167: TypeError

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Nov 19, 2019

Hi @chbndrhnns, thanks for the nudge! 1.12 released. 👍

0reactions
nicoddemuscommented, Nov 20, 2019

@richin13 thanks for confirming it. I just released 1.12.1 with a fix for this problem. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stencil e2e tests failing on server - Stack Overflow
I have a stenciljs project with unit and e2e tests that works perfectly locally but fails on server with the given error:.
Read more >
How I sped up one of our test suites by 17.5x by ... - Synopsys
Our tests were slowing down at a rate that was causing them to time out, which resulted in failing builds. I could have...
Read more >
jQuery 1.11.2 and 2.1.3 Released – Safari Fail-Safe Edition
Another bug that makes it difficult for us to test jQuery on iOS 8 is that the user agent of the simulator is...
Read more >
Running unit tests in GitHub Actions - Octopus Deploy
As part of our series about Continuous Integration and build servers, learn how to run unit tests in GitHub Actions and process the...
Read more >
1 Common Test Release Notes - Erlang/OTP
If init_per_testcase fails, the test itself is skipped. According to the documentation, it should be possible to change the ... 1.46 Common_Test 1.11.2...
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