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

assert_has_calls(foo) used to work, now doesn't #263

Closed
sdague opened this issue Jul 10, 2015 · 2 comments
Closed

assert_has_calls(foo) used to work, now doesn't #263

sdague opened this issue Jul 10, 2015 · 2 comments

Comments

@sdague
Copy link

sdague commented Jul 10, 2015

m.assert_has_calls(foo) used to work, but now fails violently if not specified as m.assert_has_calls([foo]).

The old behavior was nicer UX (given that this is often called with only a single value, at least in openstack code), and it would be nice to still support if possible.

If not it would be really good to include detailed release notes about this change.

openstack-gerrit pushed a commit to openstack/nova that referenced this issue Jul 10, 2015
This includes 2 classes of fixes (and 1 skip) for mock.

The first is the change in allowed values for assert_has_calls -
testing-cabal/mock#263

The second is a yet unsolved bug around the use of autospec
testing-cabal/mock#264

The skip is because something has changed with mock.open that is
causing the vhduils test to fail. We don't know why, but it's one test
to skip.

This also includes a brute force fix for tox -e docs, because pip is
no longer respecting the sphinx pin in test requirements. This has to
be landed with the other changes because they won't work without it.

Change-Id: Id835d080a1ada52cbd3f24dad9bab5eeb2f29a54
Partial-Bug: 1473401
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Jul 10, 2015
Project: openstack/nova  4442979e71bb09ff9b71604c0dddd37c2bede04d

Fix for mock-1.1.0

This includes 2 classes of fixes (and 1 skip) for mock.

The first is the change in allowed values for assert_has_calls -
testing-cabal/mock#263

The second is a yet unsolved bug around the use of autospec
testing-cabal/mock#264

The skip is because something has changed with mock.open that is
causing the vhduils test to fail. We don't know why, but it's one test
to skip.

This also includes a brute force fix for tox -e docs, because pip is
no longer respecting the sphinx pin in test requirements. This has to
be landed with the other changes because they won't work without it.

Change-Id: Id835d080a1ada52cbd3f24dad9bab5eeb2f29a54
Partial-Bug: 1473401
bowlofeggs pushed a commit to bowlofeggs/pulp that referenced this issue Jul 13, 2015
Pulp uses Mock in a way that is now broken[0] with the new version that was
recently released. This commit pins us to use Mock<1.1 to avoid the
problem for now. In the end, we should update our tests to use the new
Mock API as part of the work on issue pulp#1135.

[0] testing-cabal/mock#263

re pulp#1135
bowlofeggs pushed a commit to pulp/pulp that referenced this issue Jul 13, 2015
Pulp uses Mock in a way that is now broken[0] with the new version that was
recently released. This commit pins us to use Mock<1.1 to avoid the
problem for now. In the end, we should update our tests to use the new
Mock API as part of the work on issue #1135.

[0] testing-cabal/mock#263

re #1135
@rbtcollins
Copy link
Member

@sdague can you whip up a small reproducer example? I'm happy to go track this down and fix in cPython if it is there, but I'm not entirely sure what you were doing before vs now.

@rbtcollins
Copy link
Member

This is I think related to #243 - in that assert_has_calls(foo) where foo is a [], is at best ambiguous.

asmacdo pushed a commit to asmacdo/pulp that referenced this issue Sep 16, 2015
Pulp uses Mock in a way that is now broken[0] with the new version that was
recently released. This commit pins us to use Mock<1.1 to avoid the
problem for now. In the end, we should update our tests to use the new
Mock API as part of the work on issue pulp#1135.

[0] testing-cabal/mock#263

re pulp#1135
@sdague sdague closed this as completed Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants