Code Monkey home page Code Monkey logo

Comments (8)

tarangchikhalia avatar tarangchikhalia commented on May 23, 2024 1

Not sure what the root cause of the problem was but it's working fine after I recloned the repository and rebuilt the app.

from opengrok.

vladak avatar vladak commented on May 23, 2024

Cannot reproduce on Ubuntu 22.04.3 LTS with Python 3.10.12. In my case the output looks like this: pytest.txt

from opengrok.

tarangchikhalia avatar tarangchikhalia commented on May 23, 2024

Hmm.. Do you know what may have caused a problem like this?

from opengrok.

vladak avatar vladak commented on May 23, 2024

Hmm.. Do you know what may have caused a problem like this?

No idea. You can try running the commands separately to see if it reproduces this outside of Maven.

from opengrok.

tarangchikhalia avatar tarangchikhalia commented on May 23, 2024

I cleaned the workspace and ran the maven build. I can see these errors:

    return when2(fn, Ellipsis).thenAnswer(replacement)
/home/tarang/Codespace/oss/opengrok-fork/tools/.tox/py310/lib/python3.10/site-packages/mockito/mockito.py:253: in when2
    obj, name = get_obj_attr_tuple(fn)
/home/tarang/Codespace/oss/opengrok-fork/tools/.tox/py310/lib/python3.10/site-packages/mockito/utils.py:158: in get_obj_attr_tuple
    return get_function_host(path)
/home/tarang/Codespace/oss/opengrok-fork/tools/.tox/py310/lib/python3.10/site-packages/mockito/utils.py:58: in get_function_host
    obj, name = find_invoking_frame_and_try_parse()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def find_invoking_frame_and_try_parse():
        # Actually we just want the first frame in user land; we're open for
        # refactorings here and don't yet decide on which frame exactly we hit
        # that user land.
        stack = inspect.stack(3)[2:10]
        for frame_info in stack:
            # Within `patch` and `spy2` we delegate to `when2` but that's not
            # user land code
            if frame_info[3] in ('patch', 'spy2'):
                continue
    
            source = ''.join(frame_info[4] or [])
            m = FIND_ID.match(source)
            if m:
                # id should be something like `os.path.exists` etc.
                id = m.group(1)
                parts = id.split('.')
                if len(parts) < 2:
                    raise TypeError("can't guess origin of '%s'" % id)
    
                frame = frame_info[0]
                vars = frame.f_globals.copy()
                vars.update(frame.f_locals)
    
                # Now that's a simple reduce; we get the initial value from the
                # locally available `vars`, and then reduce the middle parts via
                # `getattr`. The last path component gets not resolved, but is
                # returned as plain string value.
                obj = vars.get(parts[0])
                for part in parts[1:-1]:
                    obj = getattr(obj, part)
                return obj, parts[-1]
    
>       raise TypeError('could not destructure first argument')
E       TypeError: could not destructure first argument

from opengrok.

vladak avatar vladak commented on May 23, 2024

What is the Python Mockito version used in your case ?

from opengrok.

tarangchikhalia avatar tarangchikhalia commented on May 23, 2024

Here is the Mockito details

Name: mockito
Version: 1.4.0
Summary: Spying framework
Home-page: https://github.com/kaste/mockito-python
Author: 
Author-email: 
License: MIT
Location: /home/tarang/.local/lib/python3.10/site-packages
Requires: 
Required-by: 

from opengrok.

vladak avatar vladak commented on May 23, 2024

Here is the Mockito details

Name: mockito
Version: 1.4.0
Summary: Spying framework
Home-page: https://github.com/kaste/mockito-python

Here's quote from the latest Ubuntu test run (successful) via Github actions:

py310: OK ✔ in 26.94 seconds
type: install_deps target> python -I -m pip install GitPython mockito pytest pytest-mockito
type: install_package_deps target> python -I -m pip install filelock jsonschema==2.6.0 pyyaml 'requests>=2.20.0' resource
type: install_package target> python -I -m pip install --force-reinstall --no-deps /home/runner/work/opengrok/opengrok/tools/.tox/.tmp/package/2/opengrok-tools-0.0.1.tar.gz
type: freeze target> python -m pip freeze --all
type: certifi==2023.11.17,charset-normalizer==3.3.2,exceptiongroup==1.2.0,filelock==3.13.1,gitdb==4.0.11,GitPython==3.1.40,idna==3.6,iniconfig==2.0.0,JsonForm==0.0.2,jsonschema==2.6.0,JsonSir==0.0.2,mockito==1.4.0,opengrok-tools @ file:///home/runner/work/opengrok/opengrok/tools/.tox/.tmp/package/2/opengrok-tools-0.0.1.tar.gz#sha256=5cc5a86fa2547882a8a1d503b2f80da5794ff6c9f110c1c84f3d021432ddbd8b,packaging==23.2,pip==23.3.1,pluggy==1.3.0,pytest==7.4.4,pytest-mockito==0.0.4,Python-EasyConfig==0.1.7,PyYAML==6.0.1,requests==2.31.0,Resource==0.2.1,setuptools==69.0.2,six==1.16.0,smmap==5.0.1,tomli==2.0.1,urllib3==2.1.0,wheel==0.42.0

so the mockito version is the same.

from opengrok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.