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

xdist: support for --boxed on windows #193

Closed
pytestbot opened this issue Sep 27, 2012 · 11 comments
Closed

xdist: support for --boxed on windows #193

pytestbot opened this issue Sep 27, 2012 · 11 comments
Labels
plugin: xdist related to the xdist external plugin type: enhancement new feature or API change, should be merged into features branch

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Anonymous


executing

py.test --boxed

on Windows failed with the error:

Traceback (most recent call last):
  File "c:\python27\lib\site-packages\_pytest\main.py", line 74, in wrap_session
    doit(config, session)
  File "c:\python27\lib\site-packages\_pytest\main.py", line 106, in _main
    config.hook.pytest_runtestloop(session=session)
  File "c:\python27\lib\site-packages\_pytest\core.py", line 421, in __call__
    return self._docall(methods, kwargs)
  File "c:\python27\lib\site-packages\_pytest\core.py", line 432, in _docall
    res = mc.execute()
  File "c:\python27\lib\site-packages\_pytest\core.py", line 350, in execute
    res = method(**kwargs)
  File "c:\python27\lib\site-packages\_pytest\main.py", line 119, in pytest_runtestloop
    item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
  File "c:\python27\lib\site-packages\_pytest\core.py", line 421, in __call__
    return self._docall(methods, kwargs)
  File "c:\python27\lib\site-packages\_pytest\core.py", line 432, in _docall
    res = mc.execute()
  File "c:\python27\lib\site-packages\_pytest\core.py", line 350, in execute
    res = method(**kwargs)
  File "c:\python27\lib\site-packages\pytest_xdist-1.8-py2.7.egg\xdist\plugin.py", line 85, in pytest_runtest_protocol
    reports = forked_run_report(item)
  File "c:\python27\lib\site-packages\pytest_xdist-1.8-py2.7.egg\xdist\plugin.py", line 105, in forked_run_report
    ff = py.process.ForkedFunc(runforked)
  File "c:\python27\lib\site-packages\py\_process\forkedfunc.py", line 30, in __init__
    pid = os.fork()
AttributeError: 'module' object has no attribute 'fork'

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


made the tb readable

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


seems like there should be a better error message

@pytestbot
Copy link
Contributor Author

Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


also the docs should mention it - i fixed the readme and uploaded it to pypi.python.org for the current pytest-xdist release.

@pytestbot
Copy link
Contributor Author

Original comment by Martin Fiers (BitBucket: martinfiers, GitHub: martinfiers):


We also face the same problem right now and need boxed, because our unittests require a clean Python environment (and yes, we know good unittests should be independent, but we use one global object and cannot get around this). Using boxed fixes this problem.

Is there any way we could get a similar behavior on Windows?

Forking on Windows is afaik not possible. Would it be possible to use multiprocessing to run an additional process that handles the testcases?

@pytestbot
Copy link
Contributor Author

Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


not yet and its probably easier to implement this using xdist

@pytestbot
Copy link
Contributor Author

Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):


(fix traceback again in desc which I seemed to have mangled accidentically)

@pytestbot pytestbot added type: enhancement new feature or API change, should be merged into features branch plugin: xdist related to the xdist external plugin labels Jun 15, 2015
@nicoddemus
Copy link
Member

As I understand --boxed is supposed to be deprecated anyway now that xdist supports automatically restarts slaves in the event of a crash. Should we close this?

@RonnyPfannschmidt
Copy link
Member

--boxed also has its uses in isolation, there should be a new mode in xdist (but thats like 6-10 months away)

@nicoddemus
Copy link
Member

True!

Hmm this seems tricky to implement in Windows using just subprocess, because each process does the collection and test runs.

Any thoughts?

@RonnyPfannschmidt
Copy link
Member

A test mode that's always collecting a special item should do for xdist still slow tho

@RonnyPfannschmidt
Copy link
Member

wont fix

fkohlgrueber pushed a commit to fkohlgrueber/pytest that referenced this issue Oct 27, 2018
If an expression starts or ends with a bracket and only contains a single
delimiter, don't wrap it in additional optional parentheses.  We can use the
brackets for the split.

Fixes pytest-dev#177

Fixes pytest-dev#193
mgorny pushed a commit to mgorny/pytest that referenced this issue May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: xdist related to the xdist external plugin type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

3 participants