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

print("Clearing the cache") during tests #869

Closed
agateau-gg opened this issue Aug 23, 2023 · 2 comments · Fixed by #871
Closed

print("Clearing the cache") during tests #869

agateau-gg opened this issue Aug 23, 2023 · 2 comments · Fixed by #871

Comments

@agateau-gg
Copy link

agateau-gg commented Aug 23, 2023

Describe the bug

Since 5.2.4, when pyfakefs clears its cache, it prints a "Clearing the cache" message, which looks out of place in the pytest output.

How To Reproduce

Given a dummy test file like this:

def test_foo():
    pass


def test_bar():
    pass

And pytest and pyfakefs in a new virtualenv

~/src/pyfakefsbug 
$ pew mktmpenv
created virtual environment CPython3.10.12.final.0-64 in 242ms
[...]
~/src/pyfakefsbug py3.10.12 (2d92154d397a2df) 
$ pip install pytest pyfakefs
[...]

When I run pytest, I see a "Clearing the cache" message at the end:

~/src/pyfakefsbug py3.10.12 (2d92154d397a2df) 
$ pytest
============================ test session starts ============================
platform linux -- Python 3.10.12, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/agateau/src/pyfakefsbug
plugins: pyfakefs-5.2.4
collected 2 items                                                           

test_foo.py ..                                                        [100%]Clearing the cache


============================= 2 passed in 0.00s =============================
~/src/pyfakefsbug py3.10.12 (2d92154d397a2df) 
$ pytest -v
============================ test session starts ============================
platform linux -- Python 3.10.12, pytest-7.4.0, pluggy-1.2.0 -- /home/agateau/.local/share/virtualenvs/2d92154d397a2df/bin/python
cachedir: .pytest_cache
rootdir: /home/agateau/src/pyfakefsbug
plugins: pyfakefs-5.2.4
collected 2 items                                                           

test_foo.py::test_foo PASSED                                          [ 50%]
test_foo.py::test_bar PASSED                                          [100%]Clearing the cache


============================= 2 passed in 0.00s =============================

Your environment

Linux-6.2.0-26-generic-x86_64-with-glibc2.35
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
pyfakefs 5.2.4
pytest 7.4.0

@mrbean-bremen
Copy link
Member

Ah, sorry - that was a leftover from testing that I obviously missed, will fix this. Not sure if it's worth an extra patch release though... but then releases are cheap.

@agateau-gg
Copy link
Author

Thanks! It's not a show stopper for me, I can live with it until there are enough changes for a future release :)

mrbean-bremen added a commit to mrbean-bremen/pyfakefs that referenced this issue Aug 23, 2023
mrbean-bremen added a commit that referenced this issue Aug 24, 2023
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 a pull request may close this issue.

2 participants