Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635800 - dev-python/pytest-mock-1.6.3 : E AttributeError: Mock object has no attribute assert_not_called
Summary: dev-python/pytest-mock-1.6.3 : E AttributeError: Mock object has no attribute...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zac Medico
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2017-10-29 16:50 UTC by Toralf Förster
Modified: 2017-10-30 20:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,15.97 KB, text/plain)
2017-10-29 16:50 UTC, Toralf Förster
Details
dev-python:pytest-mock-1.6.3:20171029-164856.log (dev-python:pytest-mock-1.6.3:20171029-164856.log,5.10 KB, text/plain)
2017-10-29 16:51 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,103.19 KB, text/plain)
2017-10-29 16:51 UTC, Toralf Förster
Details
environment (environment,108.18 KB, text/plain)
2017-10-29 16:51 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,12.18 KB, application/x-bzip)
2017-10-29 16:51 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,26.33 KB, application/x-bzip)
2017-10-29 16:51 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2017-10-29 16:50:54 UTC
            if name not in self._mock_methods or name in _all_magics:
>               raise AttributeError("Mock object has no attribute %r" % name)
E               AttributeError: Mock object has no attribute 'assert_not_called'

/usr/lib64/python2.7/site-packages/mock.py:667: AttributeError
================ 1 failed, 40 passed, 2 xfailed in 3.40 seconds ================

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 13.0-desktop-plasma-systemd_test_20171025-203252

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-6.4.0 *

Available Python interpreters, in order of preference:
  [1]   python3.4
  [2]   python3.6 (fallback)
  [3]   python2.7 (fallback)

java-config:
The following VMs are available for generation-2:
*)	IcedTea JDK 3.5.1 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-bin-8  system-vm

emerge -qpv dev-python/pytest-mock
[ebuild  N    ] dev-python/pytest-mock-1.6.3  PYTHON_TARGETS="python2_7 python3_4 -pypy -pypy3 -python3_5 -python3_6"
Comment 1 Toralf Förster gentoo-dev 2017-10-29 16:50:57 UTC
Created attachment 500828 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2017-10-29 16:51:00 UTC
Created attachment 500830 [details]
dev-python:pytest-mock-1.6.3:20171029-164856.log
Comment 3 Toralf Förster gentoo-dev 2017-10-29 16:51:03 UTC
Created attachment 500832 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2017-10-29 16:51:07 UTC
Created attachment 500834 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2017-10-29 16:51:10 UTC
Created attachment 500836 [details]
etc.portage.tbz2
Comment 6 Toralf Förster gentoo-dev 2017-10-29 16:51:13 UTC
Created attachment 500838 [details]
temp.tbz2
Comment 7 Zac Medico gentoo-dev 2017-10-29 23:45:28 UTC
(In reply to Toralf Förster from comment #3)
> Created attachment 500832 [details]
> emerge-history.txt

I see you have dev-python/mock-1.0.1-r2 installed, so I guess that is what owns /usr/lib64/python2.7/site-packages/mock.py.

Does it solve the problem if you upgrade to dev-python/mock-2.0.0? If so, we can change the dependency to require that.
Comment 8 Toralf Förster gentoo-dev 2017-10-30 19:46:10 UTC
(In reply to Zac Medico from comment #7)
Indeed, dev-python/mock-2.0.0 helps.

FWIW the old version was pinned due to dev-python/django-social-auth - which I had to remove before to get the newer mock being installed
Comment 9 Larry the Git Cow gentoo-dev 2017-10-30 20:15:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf607ef62711fbff989434fdef5d1eeef2638791

commit bf607ef62711fbff989434fdef5d1eeef2638791
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-10-30 20:13:39 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-10-30 20:15:10 +0000

    dev-python/pytest-mock: require mock-2 (bug 635800)
    
    Closes: https://bugs.gentoo.org/635800
    Package-Manager: Portage-2.3.13, Repoman-2.3.3

 dev-python/pytest-mock/pytest-mock-1.6.0.ebuild | 4 ++--
 dev-python/pytest-mock/pytest-mock-1.6.3.ebuild | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)