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

1 test fails: AttributeError: [...] does not have the attribute 'pwd' #376

Open
yurivict opened this issue Feb 19, 2023 · 0 comments
Open

Comments

@yurivict
Copy link

=============================================================================================== FAILURES ================================================================================================
_________________________________________________________________________ LaunchTorTests.test_launch_root_changes_tmp_ownership _________________________________________________________________________

f = <function runWithWarningsSuppressed at 0x87148a940>
args = ([], <bound method LaunchTorTests.test_launch_root_changes_tmp_ownership of <test.test_controller.LaunchTorTests testMethod=test_launch_root_changes_tmp_ownership>>), kwargs = {}

    def maybeDeferred(
        f: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs
    ) -> "Deferred[_T]":
        """
        Invoke a function that may or may not return a L{Deferred} or coroutine.
    
        Call the given function with the given arguments.  Then:
    
          - If the returned object is a L{Deferred}, return it.
    
          - If the returned object is a L{Failure}, wrap it with L{fail} and
            return it.
    
          - If the returned object is a L{types.CoroutineType}, wrap it with
            L{Deferred.fromCoroutine} and return it.
    
          - Otherwise, wrap it in L{succeed} and return it.
    
          - If an exception is raised, convert it to a L{Failure}, wrap it in
            L{fail}, and then return it.
    
        @param f: The callable to invoke
        @param args: The arguments to pass to C{f}
        @param kwargs: The keyword arguments to pass to C{f}
    
        @return: The result of the function call, wrapped in a L{Deferred} if
        necessary.
        """
        try:
>           result = f(*args, **kwargs)

/usr/local/lib/python3.9/site-packages/twisted/internet/defer.py:206: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.9/site-packages/twisted/internet/utils.py:227: in runWithWarningsSuppressed
    raise exc_info[1].with_traceback(exc_info[2])
/usr/local/lib/python3.9/site-packages/twisted/internet/utils.py:223: in runWithWarningsSuppressed
    result = f(*a, **kw)
/usr/local/lib/python3.9/site-packages/mock/mock.py:1414: in patched
    with self.decoration_helper(patched,
/usr/local/lib/python3.9/contextlib.py:119: in __enter__
    return next(self.gen)
/usr/local/lib/python3.9/site-packages/mock/mock.py:1396: in decoration_helper
    arg = exit_stack.enter_context(patching)
/usr/local/lib/python3.9/contextlib.py:448: in enter_context
    result = _cm_type.__enter__(cm)
/usr/local/lib/python3.9/site-packages/mock/mock.py:1485: in __enter__
    original, local = self.get_original()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <mock.mock._patch object at 0x88789ffa0>

    def get_original(self):
        target = self.getter()
        name = self.attribute
    
        original = DEFAULT
        local = False
    
        try:
            original = target.__dict__[name]
        except (AttributeError, KeyError):
            original = getattr(target, name, DEFAULT)
        else:
            local = True
    
        if name in _builtins and isinstance(target, ModuleType):
            self.create = True
    
        if not self.create and original is DEFAULT:
>           raise AttributeError(
                "%s does not have the attribute %r" % (target, name)
            )
E           AttributeError: <module 'txtorcon.controller' from '/usr/ports/security/py-txtorcon/work-py39/txtorcon-23.0.0/txtorcon/controller.py'> does not have the attribute 'pwd'

/usr/local/lib/python3.9/site-packages/mock/mock.py:1458: AttributeError
=========================================================================================== warnings summary ============================================================================================

Version: 23.0.0
Python-3.9
FreeBSD 13.1

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