Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG sure appears to break @patch.mock in python 3.6 #146

Open
adammartin-mednax opened this issue May 31, 2018 · 1 comment
Open

BUG sure appears to break @patch.mock in python 3.6 #146

adammartin-mednax opened this issue May 31, 2018 · 1 comment
Assignees

Comments

@adammartin-mednax
Copy link

adammartin-mednax commented May 31, 2018

Issue Type

BUG

Versions & Configuration

Sure: 1.4.11
Python: 3.6.3
Operating System: Mac

Steps to reproduce (Expected and Actual Results)

Write a test like:

from unittest import mock
import sure

@mock.patch('my_thing_to_mock', return_value=True) # Anything will work
def my_test(my_mock):
     assert True == True # Don't even need to use sure

When I execute tests:

pytest

I will then receive an error like:

  @mock.patch('my_thing_to_mock', return_value=True) # Anything will work
  def my_test(my_mock):
E       fixture 'my_mock' not found
>       available fixtures: cache, capfd, capsys, cov, doctest_namespace, monkeypatch, pytestconfig, record_xml_property, recwarn, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

I believe this is tied to sure's dependency on mock==2.0.0 my understanding from Mock is that mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards..

Since sure supports > 3.3 up to 3.7 I would expect that unittest.mock would be supported. However I could be doing it wrong! :D

@gabrielfalcao gabrielfalcao self-assigned this Sep 17, 2020
@gabrielfalcao
Copy link
Owner

@adammartin-mednax thanks for the report, I'll verify this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants