We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Indentation tests only test for indentation using spaces, and It's necessary to also test for indentation using tabs (that is partially broken #3508)
I'm thinking about using parametrize fixture to make test support several options
and I have consider different ways to organize test:
1: Each test will have parametrize options for tabs and spaces:
@pytest.mark.parametrize("indent_chars, text_input, expected", [ (" ", "\ndef function():\n", "\ndef function():\n "), ("\t", "\ndef function():\n", "\ndef function():\n\t"), ]) def test_def_with_newline(indent_chars, text_input, expected): text = get_indent_fix(text_input, indent_chars) assert text == expected, repr(text)
@pytest.mark.parametrize("indent_chars", [ (" "), ("\t"), ]) def test_def_with_newline(indent_chars): text = get_indent_fix("\ndef function():\n", indent_chars) assert text == "\ndef function():\n" + indent_chars, repr(text)
@pytest.mark.parametrize("indent_chars, text_input, expected", [ (" ", "\ndef function():\n", "\ndef function():\n "), ("\t", "\ndef function():\n", "\ndef function():\n\t"), (" ","def function():\n print []\n" , "def function():\n\tprint []\n "), ("\t","def function():\n\tprint []\n" , "def function():\n\tprint []\n\t"), ]) def test_indentation(indent_chars, text_input, expected): text = get_indent_fix(text_input, indent_chars) assert text == expected, repr(text)
which option could be the best?
cc: @Nodd @goanpeca
The text was updated successfully, but these errors were encountered:
Was this already fixed in #3680 @rlaverde?
Sorry, something went wrong.
Sorry, #3663?
Yes, I implemented the third way
rlaverde
No branches or pull requests
Indentation tests only test for indentation using spaces, and It's necessary to also test for indentation using tabs (that is partially broken #3508)
I'm thinking about using parametrize fixture to make test support several options
and I have consider different ways to organize test:
1: Each test will have parametrize options for tabs and spaces:
which option could be the best?
cc: @Nodd @goanpeca
The text was updated successfully, but these errors were encountered: