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

When using snapshots in multiple test directories, snapshot cannot be found #110

Open
scharf opened this issue Feb 7, 2020 · 1 comment

Comments

@scharf
Copy link

scharf commented Feb 7, 2020

I have multiple directories with snapshot tests and when I run the tests, snapshots are not found with errors like this:

===================================================================== ERRORS =====================================================================
_______________________________________ ERROR collecting tests/processor/snapshots/snap_test_change_log.py _______________________________________
.venv/lib/python3.8/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E   ModuleNotFoundError: No module named 'snapshots.snap_test_foo'
_______________________________________ ERROR collecting tests/processor/snapshots/snap_test_data_types.py _______________________________________
.venv/lib/python3.8/site-packages/py/_path/local.py:701: in pyimport
    __import__(modname)
E   ModuleNotFoundError: No module named 'snapshots.snap_test_bar'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

My (hacky) solution is to have one snapshot directory and symlink the directory into all places where snapshots are taken

@paulmelnikow
Copy link
Collaborator

Are you missing __init__.py's? Could you provide a sample project that illustrates the issue?

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

2 participants