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

Parameter order in assertEqual() statements #440

Closed
behrtam opened this issue Mar 22, 2017 · 4 comments · Fixed by #449
Closed

Parameter order in assertEqual() statements #440

behrtam opened this issue Mar 22, 2017 · 4 comments · Fixed by #449

Comments

@behrtam
Copy link
Contributor

behrtam commented Mar 22, 2017

We have both ways of ordering the parameters actual, expected result of the assertEqual() method.

While the Python implementation uses indifferent names (first, second - code) all examples use the order actual followed by expected (python doc – basic-example).

self.assertEqual('foo'.upper(), 'FOO')
self.assertEqual(s.split(), ['hello', 'world'])

I think it would be better to be consistent within this track. As I personally don't have any preferences I would just follow the official python documentation examples and default to self.assertEqual(actual, expected).

@rootulp @pheanex do you have any opinions about this?

@pheanex
Copy link
Contributor

pheanex commented Mar 22, 2017

(actual, expected) looks good to me. I am in favour of consistency.

@rootulp
Copy link
Contributor

rootulp commented Mar 22, 2017

I think conforming to the Python doc basic example is a god idea. (Actual, expected) seems right.

behrtam added a commit that referenced this issue Mar 23, 2017
behrtam added a commit that referenced this issue Mar 23, 2017
behrtam added a commit that referenced this issue Mar 23, 2017
mrcfps pushed a commit to mrcfps/python that referenced this issue Feb 20, 2018
cmccandless pushed a commit that referenced this issue Feb 21, 2018
* protein-translation: update tests to v1.1.0

* protein-translation: adjust assertion param order (#440)

* protein-translation: remove redundant utilities in tests
@nikclayton
Copy link

FYI -- if you run the tests in PyCharm (as I'm doing with my students) PyCharm shows the Expected/Actual results in the wrong order. The JetBrains bug for this behaviour is https://youtrack.jetbrains.com/issue/PY-27267.

@cmccandless
Copy link
Contributor

@nikclayton thank you for adding that info here.

We've run into that issue before here, but it's good to document it as a known issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants