pytest's assertion rewriting causes pytest-xdist to not being uninstalled completely

Created on 9 Feb 2019  ยท  4Comments  ยท  Source: pytest-dev/pytest

pip uninstall pytest-xdist leaves files behind when pytest has created files via its assertion rewriting:

./.venv/lib/python3.7/site-packages/xdist
โ”œโ”€โ”€ __pycache__
โ”‚ย ย  โ”œโ”€โ”€ dsession.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ looponfail.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ newhooks.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ plugin.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ remote.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ report.cpython-37-PYTEST.pyc
โ”‚ย ย  โ”œโ”€โ”€ _version.cpython-37-PYTEST.pyc
โ”‚ย ย  โ””โ”€โ”€ workermanage.cpython-37-PYTEST.pyc
โ””โ”€โ”€ scheduler
    โ””โ”€โ”€ __pycache__
        โ”œโ”€โ”€ each.cpython-37-PYTEST.pyc
        โ”œโ”€โ”€ load.cpython-37-PYTEST.pyc
        โ”œโ”€โ”€ loadfile.cpython-37-PYTEST.pyc
        โ””โ”€โ”€ loadscope.cpython-37-PYTEST.pyc

3 directories, 12 files

pip 18.1 (python 3.7.2)

I've noticed this, because pytest.importorskip will not skip it then.

rewrite bug

Most helpful comment

maybe we should take #4730 and default to .pytest_cache/pycache (even on older python versions) -- since pytest controls the pyc loading anyway there's nothing binding us to the source directories

All 4 comments

Weird, at first glance I don't think this is anything related to xdist in particular, but for every pytest plugin. ๐Ÿค”

Yeah, likely.

maybe we should take #4730 and default to .pytest_cache/pycache (even on older python versions) -- since pytest controls the pyc loading anyway there's nothing binding us to the source directories

@asottile
Sounds like a good plan.

Was this page helpful?
0 / 5 - 0 ratings