Skip to content

TST: a few changes like self.assertTrue(x == y, message) -> assert_equal(x, y) #4320

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

Merged
merged 1 commit into from
Dec 28, 2014

Conversation

argriffing
Copy link
Contributor

Upgrade the syntax of a few assertions.

@@ -57,8 +57,7 @@ def test_definition(self):
for i in FFTWDATA_SIZES:
x, yr = fftw_dct_ref(self.type, i, self.rdt)
y = dct(x, type=self.type)
self.assertTrue(y.dtype == self.rdt,
"Output dtype is %s, expected %s" % (y.dtype, self.rdt))
assert_equal(y.dtype, self.rdt)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well keep the error message; e.g.

assert_equal(y.dtype, self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WarrenWeckesser is that not pretty much the same error message given when equality fails anyway? Removing the error message also prevents the possibility of getting out of sync if the spelling of y.dtype or self.rdt ever changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the message doesn't really add anything useful in this case. Never mind!

dlax added a commit that referenced this pull request Dec 28, 2014
TST: a few changes like self.assertTrue(x == y, message) -> assert_equal(x, y)
@dlax dlax merged commit 3e2a3f7 into scipy:master Dec 28, 2014
@rgommers rgommers added the maintenance Items related to regular maintenance tasks label Dec 28, 2014
@rgommers rgommers added this to the 0.16.0 milestone Dec 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants