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

Error in arguments to pytest.mark.parameterize fails all tests #3674

Closed
3 of 4 tasks
alphaCTzo7G opened this issue Jul 9, 2018 · 2 comments
Closed
3 of 4 tasks

Error in arguments to pytest.mark.parameterize fails all tests #3674

alphaCTzo7G opened this issue Jul 9, 2018 · 2 comments
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed type: question general question, might be closed after 2 weeks of inactivity

Comments

@alphaCTzo7G
Copy link

alphaCTzo7G commented Jul 9, 2018

Thanks for submitting an issue!

Here's a quick checklist in what to include:

  • Include a detailed description of the bug or suggestion
  • pip list of the virtual environment you are using
  • pytest and operating system versions
  • Minimal example if possible

If I have a tests case say

@pytest.mark.parametrize(
	"foo_dict1, expected",
	[
		data_search_foo.second
	]
)
def test_convert_foo_df(self, foo_instance, foo_dict,
							expected):
	foo_df = foo_instance.convert_foo_df(foo_dict)
	assert foo_df == expected

and all other tests, are correctly specified, this will crash the entire
pytest test.

The error in the above is that foo_dict1 should be foo_dict. However, if I
didnt use pytest.mark.parametrize, it seems typographical errors in one
test(test1) only results in the failure of test1, but other tests in the
series of tests can still go on.

Can this be rectified?

Pytest version: 3.4.1
Operating System: Windows 10

@pytestbot pytestbot added topic: parametrize related to @pytest.mark.parametrize type: question general question, might be closed after 2 weeks of inactivity labels Jul 9, 2018
@pytestbot
Copy link
Contributor

GitMate.io thinks possibly related issues are #1111 (pytest.mark.parametrize fails with lambdas), #3645 (validate arguments of parametrize mark), #747 (flakes test fail), #2077 (Error with own 'conf' argument with 'tests/ANY' value), and #821 (Running py.test without arguments raises missing argument error).

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jul 9, 2018
@Zac-HD
Copy link
Member

Zac-HD commented Oct 19, 2018

Closing as duplicate of #3645, which proposes improving the error in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parametrize related to @pytest.mark.parametrize type: bug problem that needs to be addressed type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants