We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
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
The read-in-tests-from-file functionality as shown here: #12085 doesn't seem to work for parameterized tests.
tests.py
Write the following in a test.py file:
test.py
# test_add.py import pytest # add.py def add(a, b): return a + b @pytest.mark.parametrize("a, b, expected", [ (1, 2, 3), (0, 0, 0), (-1, 1, 0), (10, 20, 30), (1.5, 2.5, 4.0), ]) def test_add(a, b, expected): assert add(a, b) == expected
tests.txt
Now write a couple of tests in a tests.txt file:
test.py::test_add[1-2-3] test.py::test_add[0-0-0]
Now try:
pytest @tests.txt
The text was updated successfully, but these errors were encountered:
Sorry I made a typo everything works just fine - thanks for the nice new feature!
Sorry, something went wrong.
No branches or pull requests
The "@" functionality doesn't seem to work for parameterized tests
The read-in-tests-from-file functionality as shown here: #12085 doesn't seem to work for parameterized tests.
Repro
tests.py
fileWrite the following in a
test.py
file:tests.txt
fileNow write a couple of tests in a
tests.txt
file:Result
Now try:
Update - never mind everything works just fine
The text was updated successfully, but these errors were encountered: