-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Don't crash with --pyargs and a filename that looks like a module #5503
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
Conversation
def test_pyargs_filename_looks_like_module(self, testdir): | ||
testdir.tmpdir.join("conftest.py").ensure() | ||
testdir.tmpdir.join("t.py").write("def test(): pass") | ||
result = testdir.runpytest("--pyargs", "t.py") |
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.
Hmm what happens here? Does it run the file? Is that what's expected?
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 runs the file, yes -- it's at least consistent with the 4.6.x behaviour -- I didn't really consider whether this is sane / correct or not 😆
I've never really worked with --pyargs
so I'm not sure what the expected thing is here
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.
Well if it works like 4.6.x then that's fine by me!
Thanks for the quick fix!
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.
Only missing a CHANGELOG entry. 👍
def test_pyargs_filename_looks_like_module(self, testdir): | ||
testdir.tmpdir.join("conftest.py").ensure() | ||
testdir.tmpdir.join("t.py").write("def test(): pass") | ||
result = testdir.runpytest("--pyargs", "t.py") |
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.
Well if it works like 4.6.x then that's fine by me!
Thanks for the quick fix!
That is, unless that bug was never released in the first place. |
:this: |
@nicoddemus approve? :D |
Oh sorry! |
Feel free to cut the 5.0.0 release; I won't have time until later today |
sounds good! I'll take a stab at it and fix up the things in the original PR 👍 |
Awesome 🎉 |
No description provided.