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

pytest 2.6 no longer works with mocks and fixtures #554

Closed
pytestbot opened this issue Aug 1, 2014 · 5 comments
Closed

pytest 2.6 no longer works with mocks and fixtures #554

pytestbot opened this issue Aug 1, 2014 · 5 comments
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: sontek, GitHub: sontek


I have a test that looks like this:

@pytest.mark.unit
@mock.patch('ansvc.v1.lib.decorators.invalidate_highfiver')
@mock.patch('ansvc.v1.lib.decorators.invalidate_tags')
@mock.patch('ansvc.v1.models.surveys.is_survey_dirty')
def test_rollups_simple_no_filter_or_compare_valid_json(hf, ig, isd):

and I get the error:

10:47:47         fixture 'hf' not found
10:47:47         available fixtures: capfd, tmpdir, recwarn, wsgiapp, monkeypatch, cov, capsys, pytestconfig, session
10:47:47         use 'py.test --fixtures [testpath]' for help on them.

pytest 2.5.2 works, pytest 2.6.0 does not. Currently only seeing the failure in python 3.4 but have to dig into it more.


@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: sontek, GitHub: sontek:


cc @msabramo

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


Could you retry with "pip install -U --pre -i https://devpi.net/hpk/dev pytest" (should give you 2.6.1.dev3 at least)? I think we might have fixed it already.

@pytestbot
Copy link
Contributor Author

Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):


Hi, I believe this was fixed as part of https://bitbucket.org/hpk42/pytest/pull-request/184 and subsequent commits. At least I could not reproduce a variation of the example you gave. Please feel free to reopen if you can reproduce this with the current code in the repo.

@pytestbot
Copy link
Contributor Author

Original comment by Alexandre Conrad (BitBucket: aconrad, GitHub: aconrad):


The problem described above is because mock 1.0.1 and unittest.mock (shipped with py34) seem to behave differently.

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


So what's the exact way to reproduce the problem with pytest trunk (or 2.6.2)?

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

1 participant