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

Failed to make tests working with plain pytest #107

Open
mcepl opened this issue Jul 5, 2023 · 0 comments
Open

Failed to make tests working with plain pytest #107

mcepl opened this issue Jul 5, 2023 · 0 comments

Comments

@mcepl
Copy link

mcepl commented Jul 5, 2023

While packaging python-redis-lock for openSUSE (version 4.0.0) I have still not been able to make the test suite run. I don’t think we can use plain run of tox, because it starts to pull packages from the Internet (even though we have them already installed), and we don’t have any network connection for the building processes. So, I tried to (with help of some resources on the Internet) run tests like this:

%check
# redis-server is in sbin
export PATH=$PATH:%{_sbindir}
export PYTHONPATH=$(pwd)/tests
export DJANGO_SETTINGS_MODULE=test_project.settings
# gh#ionelmc/python-redis-lock#86
%pytest -k 'not test_no_overlap2'

unfortunately it still fails with

[   12s]   File "/home/abuild/rpmbuild/BUILD/python-redis-lock-4.0.0/tests/test_project/settings.py", line 14, in <module>
[   12s]     REDIS_SOCKET = os.environ['REDIS_SOCKET']
[   12s]   File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
[   12s]     raise KeyError(key) from None
[   12s] KeyError: 'REDIS_SOCKET'

(complete log of the whole building and testing process

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