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

Add flake8-pytest-style to linting #512

Merged
merged 3 commits into from
Apr 14, 2022
Merged

Conversation

gaugup
Copy link
Collaborator

@gaugup gaugup commented Mar 31, 2022

Signed-off-by: Gaurav Gupta gaugup@microsoft.com

Signed-off-by: Gaurav Gupta <gaugup@microsoft.com>
@gaugup
Copy link
Collaborator Author

gaugup commented Mar 31, 2022

@imatiach-msft, what does the test test_column_exception_without_brackets trying to test for DataMpper. Since all the code below is under pytest.raises so it fails for the wrong reason.

    def test_column_exception_without_brackets(self):
        with pytest.raises(ValueError):
            x = np.ones((2, 3))
            x[0, 0] = 0
            encoder = OneHotEncoder()
            encoder.fit(x[0])
            data_mapper = DataMapper([[0], encoder])
            data_mapper.transform(x)

correcting the code to below makes it fail.

    def test_column_exception_without_brackets(self):
        x = np.ones((2, 3))
        x[0, 0] = 0
        encoder = OneHotEncoder()
        encoder.fit(x)
        data_mapper = DataMapper([([0, 1, 2], encoder)])
        data_mapper.transform(x)
        with pytest.raises(ValueError):
            data_mapper.transform(x)

Not entirely sure what is this function trying to test? Shall we remove it?

@imatiach-msft
Copy link
Collaborator

@gaugup good idea, we can remove it

@gaugup
Copy link
Collaborator Author

gaugup commented Apr 14, 2022

test_column_exception_without_brackets

Thanks @imatiach-msft. Removed the test.

@gaugup gaugup merged commit d9e7135 into master Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants