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

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

Closed
blueyed opened this issue Feb 9, 2019 · 4 comments
Labels
topic: rewrite related to the assertion rewrite mechanism type: bug problem that needs to be addressed

Comments

@blueyed
Copy link
Contributor

blueyed commented Feb 9, 2019

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.

@blueyed blueyed added type: bug problem that needs to be addressed topic: rewrite related to the assertion rewrite mechanism labels Feb 9, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Feb 9, 2019
blueyed added a commit to blueyed/pytest that referenced this issue Feb 9, 2019
@nicoddemus
Copy link
Member

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

@blueyed
Copy link
Contributor Author

blueyed commented Feb 9, 2019

Yeah, likely.

@asottile
Copy link
Member

asottile commented Feb 9, 2019

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

@blueyed
Copy link
Contributor Author

blueyed commented Feb 10, 2019

@asottile
Sounds like a good plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: rewrite related to the assertion rewrite mechanism type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

3 participants