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

INTERNALERROR> AttributeError: 'Config' object has no attribute 'cache' #130

Open
whhsu2 opened this issue Nov 1, 2024 · 0 comments
Open

Comments

@whhsu2
Copy link

whhsu2 commented Nov 1, 2024

Bug Report

Environment
pytest==8.3.0, pytest-memray==1.7.0

Repro Steps
pytest --memray -p no:cacheprovider gets the error

    if _config.cache is not None:
AttributeError: 'Config' object has no attribute 'cache'

This is due to here:

if _config.cache is not None:

    if _config.cache is not None:
        cache = _config.cache.get(f"memray/{_test_id}", {})
        previous = cache.get("total_allocated_memory", float("inf"))

Expected behavior/code
Able to run pytest memray without the cacheprovider plugin

Possible Solution
Replace if _config.cache is not None: with if getattr(_config, 'cache', None) is not None:

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

No branches or pull requests

1 participant