-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Path()
convertion required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just nice for the unified API and paths comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider the alternative:
- Keep
unix_sockname
fixture. Drop all the rest:need_unix
marker,IS_
constants etc. - In
unix_sockname
always create a socket path as/tmp/{uuid}.sock
on 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change 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.