Don't crash with --pyargs and a filename that looks like a module#5503
Don't crash with --pyargs and a filename that looks like a module#5503nicoddemus merged 1 commit intopytest-dev:masterfrom asottile:pyargs_python_file
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.
Hmm what happens here? Does it run the file? Is that what's expected?
There was a problem hiding this comment.
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.
Well if it works like 4.6.x then that's fine by me!
Thanks for the quick fix!
nicoddemus
left a comment
There was a problem hiding this comment.
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.
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.