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

6.1: two test_security_proxy tests fails #72

Closed
mtelka opened this issue Oct 3, 2024 · 7 comments · Fixed by #73
Closed

6.1: two test_security_proxy tests fails #72

mtelka opened this issue Oct 3, 2024 · 7 comments · Fixed by #73
Assignees

Comments

@mtelka
Copy link

mtelka commented Oct 3, 2024

BUG/PROBLEM REPORT / FEATURE REQUEST

What I did:

I ran tests for zope.proxy version 6.1.

What I expect to happen:

All tests pass.

What actually happened:

Two tests failed:

Failure in test test_security_proxy (zope.proxy.tests.test_proxy.Test_removeAllProxies)
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/data/builds/ul-perl-modules/components/python/zope.proxy/build/prototype/i386/usr/lib/python3.9/vendor-packages/zope/proxy/tests/test_proxy.py", line 1337, in test_security_proxy
    self.assertIs(self._callFUT(proxy), c)
  File "/usr/lib/python3.9/unittest/case.py", line 1118, in assertIs
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib/python3.9/unittest/case.py", line 676, in fail
    raise self.failureException(msg)
AssertionError: <security proxied zope.proxy.tests.test_proxy.C instance at 0x7fffabab7670> is not <zope.proxy.tests.test_proxy.Test_py_removeAllProxies.test_security_proxy.<locals>.C object at 0x7fffabab7670>
Failure in test test_security_proxy (zope.proxy.tests.test_proxy.Test_sameProxiedObjects)
Traceback (most recent call last):
  File "/usr/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/data/builds/ul-perl-modules/components/python/zope.proxy/build/prototype/i386/usr/lib/python3.9/vendor-packages/zope/proxy/tests/test_proxy.py", line 1110, in test_security_proxy
    self.assertTrue(self._callFUT(proxy1, proxy1_2))
  File "/usr/lib/python3.9/unittest/case.py", line 688, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

When I run tests for zope.proxy version 6.0 then all tests pass.

What version of Python and Zope/Addons I am using:

Operating system: OpenIndiana
Python: 3.9.20
Zope.proxy: 6.1

@mtelka
Copy link
Author

mtelka commented Oct 3, 2024

Please note that I run tests with zope.security 7.2.

@perrinjerome perrinjerome self-assigned this Oct 4, 2024
@perrinjerome
Copy link
Contributor

You need zope.security 7.3 for the tests.

There was zopefoundation/zope.security#115 and #71 recently and it's necessary to have the latest version of the two packages otherwise running zope.proxy fails with exactly this issue.

Test pass on CI https://github.com/zopefoundation/zope.proxy/actions/runs/11146429667 and when I try a command to run tox from the package on pypi it also passes:

curl -L https://files.pythonhosted.org/packages/5c/1c/d051c6a2968a189787c7ed8f789201dd7ee0f40e5c1553ea513bdbd21dcf/zope_proxy-6.1.tar.gz | tar xzf - ; cd zope_proxy-6.1 ; python3 -m venv venv ; ./venv/bin/pip install tox ; ./venv/bin/tox -e py39,py39-pure 
...
  py39-pure: OK (4.32=setup[3.45]+cmd[0.25,0.61] seconds)
  congratulations :) (9.89 seconds)

I think we can close but if you still experience the problem with zope.security 7.3 let me know

@mtelka
Copy link
Author

mtelka commented Oct 4, 2024

If that's the case then I'd expect something like zope.security >= 7.3 in setup.py.

@perrinjerome
Copy link
Contributor

Thanks, that's a good point. After the two pull requests, zope.security was made to depend on newer zope.proxy because when running with old zope.proxy, there are some things that would not work at runtime, but using zope.proxy with a too old zope.security is only a problem to run the tests, so I thought we don't need to add a version constraint, but that was probably a mistake.

@d-maurer
Copy link

d-maurer commented Oct 4, 2024 via email

@perrinjerome
Copy link
Contributor

I have prepared the changes ( because I feel guilty for breaking things here :) ) but I also feel that it seems not really needed.

@mtelka
Copy link
Author

mtelka commented Oct 4, 2024

I'm okay with #73 and the release of 6.2 delayed until really needed.

Thank you!

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 a pull request may close this issue.

3 participants