Skip to content

Test-freshness plugin crashes any pytest run with the cache provider disabled #18

Description

@BrennanTM

NaviNIBS/util/testing/freshness.py (resolveTestWorkingDir, ~line 80) uses config.cache unguarded. Because the plugin is registered as a pytest11 entry point, any pytest invocation in the environment with the cache provider disabled fails at collection for every test:

$ pytest -p no:cacheprovider tests/test_util
INTERNALERROR> AttributeError: 'Config' object has no attribute 'cache'

NAVINIBS_TEST_FRESHNESS=off doesn't guard this call site (the env-var check happens later).

Suggested fix: cache = getattr(config, 'cache', None), fall back to defaultTestWorkingDir() when it's absent, and honor the env-var opt-out before touching the cache at all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions