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

Delete temporary file #165

Merged
merged 2 commits into from
Feb 10, 2022
Merged

Conversation

vhernando
Copy link

If tempdir is not set in Queue initialization, a temporary file is created to test if default tempdir is in the same filesystem as queue path.

This patch deletes this temporary file to avoid accumulation of junk temporary files after several executions.

@peter-wangxu
Copy link
Owner

@vhernando the tests failed due to the removal

@vhernando
Copy link
Author

I have no windows machine to test, but probably this will solve it.

@vhernando
Copy link
Author

In my machine the test that fails does succeed:

$ tox -e cover
...
cover installed: appdirs==1.4.4,cov-core==1.15.0,coverage==5.5,distlib==0.3.1,dnspython==1.16.0,eventlet==0.31.0,filelock==3.0.12,flake8==3.9.2,greenlet==1.1.0,mccabe==0.6.1,mock==4.0.3,msgpack==1.0.2,nose2==0.10.0,-e git+https://github.com/vhernando/persist-queue@d638b6d4cd9bda554b4d97beba1cb124cf097513#egg=persist_queue,pycodestyle==2.7.0,pyflakes==2.3.1,six==1.16.0,virtualenv==20.4.6
cover run-test-pre: PYTHONHASHSEED='308606054'
cover run-test: commands[0] | nose2 --with-coverage --coverage-report xml --coverage-report html --coverage-report term
....WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
.................WARNING:persistqueue.sqlackqueue:resume 1 unack tasks
WARNING:persistqueue.sqlackqueue:resume 1 unack tasks
.....WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
WARNING:persistqueue.sqlackqueue:Can't find item in unack cache.
.....sss.ss.s....ss........sssss.s....s.......s...............................................................................................................

Ran 184 tests in 2634.166s

OK (skipped=16)
Name Stmts Miss Branch BrPart Cover

persistqueue/init.py 14 4 0 0 71%
persistqueue/common.py 9 1 2 1 82%
persistqueue/exceptions.py 8 2 0 0 75%
persistqueue/pdict.py 50 1 2 0 98%
persistqueue/queue.py 217 28 86 10 83%
persistqueue/serializers/init.py 0 0 0 0 100%
persistqueue/serializers/json.py 12 0 0 0 100%
persistqueue/serializers/msgpack.py 20 2 8 2 79%
persistqueue/serializers/pickle.py 17 1 8 1 84%
persistqueue/sqlackqueue.py 243 16 76 18 89%
persistqueue/sqlbase.py 136 7 22 3 92%
persistqueue/sqlqueue.py 134 6 42 7 93%
persistqueue/tests/init.py 0 0 0 0 100%
persistqueue/tests/test_pdict.py 65 1 10 1 97%
persistqueue/tests/test_queue.py 232 0 40 0 100%
persistqueue/tests/test_sqlackqueue.py 317 0 44 0 100%
persistqueue/tests/test_sqlqueue.py 299 0 52 0 100%

TOTAL 1773 69 392 43 94%

__________________________________________ summary ___________________________________________
cover: commands succeeded
congratulations :)

Copy link
Owner

@peter-wangxu peter-wangxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peter-wangxu peter-wangxu merged commit d6ed33d into peter-wangxu:master Feb 10, 2022
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

Successfully merging this pull request may close these issues.

2 participants