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

Fix tests on Python 2 #43

Merged
merged 1 commit into from
Nov 12, 2019
Merged

Conversation

cjwatson
Copy link
Contributor

ZODB 5.5.0 added an "import mock" to ZODB.tests.util (or "from unittest
import mock" on Python 3, which is in the standard library). ZODB[test]
included the new dependency, but zope.component wasn't using that for
tests.

However, ZODB.tests.util.DB was just an import of
ZODB.MappingStorage.DB, so we can just as easily use the latter and
avoid the extra dependency.

ZODB 5.5.0 added an "import mock" to ZODB.tests.util (or "from unittest
import mock" on Python 3, which is in the standard library).  ZODB[test]
included the new dependency, but zope.component wasn't using that for
tests.

However, ZODB.tests.util.DB was just an import of
ZODB.MappingStorage.DB, so we can just as easily use the latter and
avoid the extra dependency.
@jamadden
Copy link
Member

Can you please mention where this was a problem? I must be missing something, but I'm not sure what.

The last Python 2.7 build on master was from about 14 hours ago as I write this, and it passed. It uses 'pip install -U -e .[test]' to get ZODB 5.5.1 and then uses Sphinx to run doctests which appears to include docs/api/persistent.rst. I can't find any indication that it installed mock.

@cjwatson
Copy link
Contributor Author

I'm somewhat confused that it passed on Travis. I can't look properly right now, but I just ran tox locally in the ordinary way and the api/persistent test failed there.

Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I can reproduce the failure with tox -e py27. I guess the Travis images come with mock preinstalled for some reason.

@cjwatson cjwatson merged commit a223516 into zopefoundation:master Nov 12, 2019
@cjwatson cjwatson deleted the fix-py2-tests branch November 12, 2019 08:16
@jugmac00
Copy link
Member

I guess the Travis images come with mock preinstalled for some reason.

At least it was (documented) for Trusty:
https://docs.travis-ci.com/user/reference/trusty/#pre-installed-pip-packages

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.

None yet

4 participants