Skip to content

Cannot run with -p no:tmpdir option #22

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

Closed
yoloseem opened this issue Dec 3, 2015 · 9 comments
Closed

Cannot run with -p no:tmpdir option #22

yoloseem opened this issue Dec 3, 2015 · 9 comments

Comments

@yoloseem
Copy link
Contributor

yoloseem commented Dec 3, 2015

When I use xdist option with -p no:tmpdir also set, it causes AttributeError: 'Config' object has no attribute '_tmpdirhandler':

$ py.test -n auto -p no:tmpdir test.py
================================================= test session starts ==================================================
platform darwin -- Python 2.7.9, pytest-2.8.3, py-1.4.31, pluggy-0.3.1
django settings: proj.settings.local (from environment variable)
rootdir: /Users/khj/works/projrepo/proj, inifile: pytest.ini
plugins: cov-2.1.0, django-2.9.1, xdist-1.13.1
gw0 C / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 IINTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/_pytest/main.py", line 88, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/xdist/dsession.py", line 494, in pytest_sessionstart
INTERNALERROR>     nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/xdist/slavemanage.py", line 45, in setup_nodes
INTERNALERROR>     nodes.append(self.setup_node(spec, putevent))
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/xdist/slavemanage.py", line 54, in setup_node
INTERNALERROR>     node.setup()
INTERNALERROR>   File "/Users/khj/.pyenv/versions/proj/lib/python2.7/site-packages/xdist/slavemanage.py", line 216, in setup
INTERNALERROR>     basetemp = self.config._tmpdirhandler.getbasetemp()
INTERNALERROR> AttributeError: 'Config' object has no attribute '_tmpdirhandler'

System info:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11
BuildVersion:   15A284
$ pip freeze | grep -i pytest
pytest==2.8.3
pytest-cov==2.1.0
pytest-django==2.9.1
pytest-xdist==1.13.1
@nicoddemus
Copy link
Member

Hmm this might be fixed already in the features branch, due to fixes in how configuration options are transferred to workers...

@yoloseem
Copy link
Contributor Author

yoloseem commented Dec 3, 2015

Issue reproduced with pytest-2.9.0.dev1 ($ pip install git+https://github.com/pytest-dev/pytest.git@features).

@nicoddemus do you have any idea to try by myself in advance?

@nicoddemus
Copy link
Member

Sorry, now that I took a look at the code it's clear that it is a distx bug... Unfortunately there's no workaround, we'll have to work on a fix.

Out of curiosity, why are you disabling tmpdir?

@yoloseem
Copy link
Contributor Author

yoloseem commented Dec 4, 2015

@nicoddemus In my proj, there was an implementation causing error due to conflicts with tmpdir of pytest, but I can't remember the details :-/ I've just checked without tmpdir, however suddenly the issue has gone....

@nicoddemus
Copy link
Member

You mean re-enabling tmpdir fixed this issue?

@yoloseem
Copy link
Contributor Author

yoloseem commented Dec 4, 2015

@nicoddemus No. I mean that I don't need to use -p no:tmpdir for testing my project anymore. But xdist still fails with disabling tmpdir.

@hpk42
Copy link
Contributor

hpk42 commented Dec 4, 2015

disabling a builtin plugin is bound to give problems. IOW, xdist relies on a builtin plugin which is kind of fine. Maybe someone can check h ow easy it would be to allow xdist to run with no:tmpdir but otherwise i suggest to close the issue.

@hpk42 hpk42 added enhancement and removed bug labels Dec 4, 2015
@nicoddemus
Copy link
Member

No. I mean that I don't need to use -p no:tmpdir for testing my project anymore.

That's what I meant by "re-enabling tmpdir". 😁 sorry for not being clearer.

@hpk42 I will take a look today, should be simple and I think it's worth it, as the message received by the user is not friendly.

@yoloseem
Copy link
Contributor Author

yoloseem commented Dec 4, 2015

Awesome. Thanks!

nicoddemus added a commit to nicoddemus/pytest-xdist that referenced this issue Dec 5, 2015
blueyed added a commit to blueyed/pytest-xdist that referenced this issue Mar 31, 2020
Fixes pytest-dev#510.
Ref: pytest-dev/pytest#6767

Also uses `--basetemp` with `-p no:tmpdir` as a good side effect
(ref: pytest-dev#22).
blueyed added a commit to blueyed/pytest-xdist that referenced this issue Mar 31, 2020
Fixes pytest-dev#510.
Ref: pytest-dev/pytest#6767

Also uses `--basetemp` with `-p no:tmpdir` as a good side effect
(ref: pytest-dev#22).
blueyed added a commit to blueyed/pytest-xdist that referenced this issue Mar 31, 2020
Fixes pytest-dev#510.
Ref: pytest-dev/pytest#6767

Also uses `--basetemp` with `-p no:tmpdir` as a good side effect
(ref: pytest-dev#22).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants