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

Error on warnings. #1899

Merged
merged 11 commits into from Mar 8, 2020
Merged

Error on warnings. #1899

merged 11 commits into from Mar 8, 2020

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Oct 31, 2019

Fixes #1823

@jaraco jaraco closed this Oct 31, 2019
@jaraco jaraco reopened this Oct 31, 2019
@jaraco jaraco force-pushed the feature/1823-fail-warnings branch from 9816a22 to 96bc308 Compare Oct 31, 2019
pytest.ini Outdated Show resolved Hide resolved
@jaraco jaraco added the draft label Nov 17, 2019
pytest.ini Show resolved Hide resolved
@jaraco jaraco closed this Mar 7, 2020
@jaraco jaraco reopened this Mar 7, 2020
@jaraco
Copy link
Member Author

jaraco commented Mar 8, 2020

I see this error on Python 2. I'm just going to suppress it.

___________________________________________________ TestExceptionSaver.test_sandbox_violation_raised_hiding_setuptools ___________________________________________________

self = <setuptools.tests.test_sandbox.TestExceptionSaver instance at 0x10c5f5560>
tmpdir = local('/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pytest-of-jaraco/pytest-30/test_sandbox_violation_raised_0')

    def test_sandbox_violation_raised_hiding_setuptools(self, tmpdir):
        """
        When in a sandbox with setuptools hidden, a SandboxViolation
        should reflect a proper exception and not be wrapped in
        an UnpickleableException.
        """
    
        def write_file():
            "Trigger a SandboxViolation by writing outside the sandbox"
            with open('/etc/foo', 'w'):
                pass
    
        with pytest.raises(setuptools.sandbox.SandboxViolation) as caught:
            with setuptools.sandbox.save_modules():
                setuptools.sandbox.hide_setuptools()
                with setuptools.sandbox.DirectorySandbox(str(tmpdir)):
>                   write_file()

setuptools/tests/test_sandbox.py:125: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py:35: in __exit__
    self.gen.throw(type, value, traceback)
setuptools/sandbox.py:166: in save_modules
    saved_exc.resume()
setuptools/sandbox.py:141: in resume
    six.reraise(type, exc, self._tb)
setuptools/sandbox.py:154: in save_modules
    yield saved
setuptools/tests/test_sandbox.py:125: in test_sandbox_violation_raised_hiding_setuptools
    write_file()
setuptools/tests/test_sandbox.py:118: in write_file
    with open('/etc/foo', 'w'):
setuptools/sandbox.py:418: in _open
    self._violation("open", path, mode, *args, **kw)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <setuptools.sandbox.DirectorySandbox instance at 0x10c5f5a70>, operation = 'open', args = ('/etc/foo', 'w'), kw = {}

    def _violation(self, operation, *args, **kw):
>       from setuptools.sandbox import SandboxViolation
E       RuntimeWarning: Parent module 'setuptools' not found while handling absolute import

setuptools/sandbox.py:406: RuntimeWarning

@jaraco jaraco force-pushed the feature/1823-fail-warnings branch from 9d6e937 to 46430d4 Compare Mar 8, 2020
@jaraco jaraco merged commit 37e1ca6 into master Mar 8, 2020
3 of 5 checks passed
@jaraco jaraco deleted the feature/1823-fail-warnings branch Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI should fail on deprecation warnings
3 participants