Shorten too long test UNIX socket path#3832
Conversation
0306e04 to
52db4a1
Compare
|
@asvetlov should be good to go now. Plz test on your machine as well :) |
tests/conftest.py
Outdated
|
|
||
| root_tmp_dir = Path('/tmp').resolve() | ||
| os_tmp_dir = Path(os.getenv('TMPDIR', '/tmp')).resolve() | ||
| original_base_tmp_path = Path(tmp_path_factory.getbasetemp()) |
There was a problem hiding this comment.
It's just nice for the unified API and paths comparison.
asvetlov
left a comment
There was a problem hiding this comment.
The whole PR can be replaced with PYTEST_DEBUG_TEMPROOT=/tmp in CI config, isn't it?
|
@asvetlov I wanted something more generic and detached from CI. |
tests/conftest.py
Outdated
|
|
||
| root_tmp_dir = Path('/tmp').resolve() | ||
| os_tmp_dir = Path(os.getenv('TMPDIR', '/tmp')).resolve() | ||
| original_base_tmp_path = Path(str(tmp_path_factory.getbasetemp())) |
There was a problem hiding this comment.
What is the reason for Path -> str -> Path conversion?
If there is something please describe it in a comment
There was a problem hiding this comment.
Yes, I do the comparison in a few places below. So I need a few Path() objects.
And str() in this line is only needed for Python 3.5 support which apparently cannot do this by its own.
asvetlov
left a comment
There was a problem hiding this comment.
Please consider the alternative:
- Keep
unix_socknamefixture. Drop all the rest:need_unixmarker,IS_constants etc. - In
unix_socknamealways create a socket path as/tmp/{uuid}.sockon systems withAF_UNIX, otherwise callpytest.skip(). The code should be about 5 lines long.
What do you think?
|
I think that the pytest's default place for the socket creation is better because it's better scoped. |
|
P.S. In general, I like the marker more as it's cleaner. |
asvetlov
left a comment
There was a problem hiding this comment.
Ok, please merge when green.
I don't care too much honestly but can live with the PR if you did all work already :)
Skip marks don't work in fixtures
491924d to
5825337
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Backport to 3.8: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 8e9e39b on top of patchback/backports/3.8/8e9e39b61e118f00029a1d9300323fdcd7f0ff67/pr-3832 Backporting merged PR #3832 into master
🤖 @patchback |
Backport to 3.9: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 8e9e39b on top of patchback/backports/3.9/8e9e39b61e118f00029a1d9300323fdcd7f0ff67/pr-3832 Backporting merged PR #3832 into master
🤖 @patchback |
What do these changes do?
Make tmp unix sock path fit the kernel limits
Are there changes in behavior for the user?
Related issue number
Fixes #3572
Checklist
CONTRIBUTORS.txtCHANGESfolder<issue_id>.<type>for example (588.bugfix)issue_idchange it to the pr id after creating the pr.feature: Signifying a new feature..bugfix: Signifying a bug fix..doc: Signifying a documentation improvement..removal: Signifying a deprecation or removal of public API..misc: A ticket has been closed, but it is not of interest to users.