Skip to content

Conversation

@mimi1vx
Copy link
Contributor

@mimi1vx mimi1vx commented Aug 22, 2018

from Python 3.3 is mock part of python standard library in unittest namespace

Thanks for submitting a PR, your contribution is really appreciated!

  • Target the master branch for bug fixes, documentation updates and trivial changes.
  • Include new tests or update existing tests when applicable.
  • Add yourself to AUTHORS -- already in

from Python 3.3 is mock part of python standard library in unittest namespace
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 92.638% when pulling cd07c4d on mimi1vx:test_mock into 2137e2b on pytest-dev:master.

@wimglenn
Copy link
Member

Preferably other way around, no? (try stdlib import first, else fallback to mock from pypi)

@nicoddemus
Copy link
Member

TBH I'm not sure why this is needed, after all the recommended way to run the tests using tox, which install the appropriate dependencies.

@mimi1vx
Copy link
Contributor Author

mimi1vx commented Aug 23, 2018

@nicoddemus because mock package isn't needed on modern python, so some distributions stop providing it for python3.

and for example, openSUSE run testsuite during package build

plus is +- same commit as #3612

@mimi1vx
Copy link
Contributor Author

mimi1vx commented Aug 23, 2018

@wimglenn in past was requested first mock and if isnt installed use stdlib. ( mock package is still devel package for stdlib)

@asottile
Copy link
Member

Here's the context for that comment btw: #3612 (comment)

(also I've seen from unittest import mock more commonly than import unittest.mock as mock -- they do the same thing so nbd)

@nicoddemus
Copy link
Member

@nicoddemus because mock package isn't needed on modern python, so some distributions stop providing it for python3.

Ah OK, that makes sense, thanks for the context. 👍

@nicoddemus nicoddemus merged commit d10d59c into pytest-dev:master Aug 23, 2018
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

Successfully merging this pull request may close these issues.

5 participants