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

pytest main does not detect some invalid nodeid names #10273

Open
elbehery95 opened this issue Sep 5, 2022 · 0 comments
Open

pytest main does not detect some invalid nodeid names #10273

elbehery95 opened this issue Sep 5, 2022 · 0 comments
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed

Comments

@elbehery95
Copy link
Contributor

elbehery95 commented Sep 5, 2022

Test scenario

test_file.py

import pytest

@pytest.mark.parametrize("bar", [1,2,3])
def test_foo(bar):
    print(bar)

The following invalid nodeid is accepted by pytest instead of printing an error

$ pytest "test_file.py[foobar]" -q

...        [100%]
3 passed in 0.04s

Expected

Similar to specifying wrong path/dir/parameterized nodeid an error should be printed instead of running all the tests in the given file

$ pytest "test_file.py[foobar]" -q

no tests ran in 0.01s
ERROR: file or directory not found: test_hello.py[foobar]
elbehery95 added a commit to elbehery95/pytest that referenced this issue Sep 5, 2022
resolve_collection_argument no longer return an empty string when selection separator is specified to test name
@Zac-HD Zac-HD added type: bug problem that needs to be addressed topic: collection related to the collection phase labels Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants