Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Order of arguments to assertEqual: is Pythoscope consistent with the convention in Python?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
FM  
View profile  
 More options Jan 14 2011, 10:25 am
From: FM <montyhind...@gmail.com>
Date: Fri, 14 Jan 2011 07:25:25 -0800 (PST)
Local: Fri, Jan 14 2011 10:25 am
Subject: Order of arguments to assertEqual: is Pythoscope consistent with the convention in Python?
I don't know whether Python has a consistent convention on this
subject. The documentation for Python's unittest does not make a
strong statement, referring to the two arguments simply as `first` and
`second`. However, all of the examples for assertEqual are framed in
this order:

assertEqual(ACTUAL, EXPECTED, MESSAGE)

In addition, the documentation for assertItemsEqual and
assertDictEqual explicitly uses that ordering.

Based on some quick Googling, I observed the following camps regarding
this issue:

Actual first:

    Python unittest
    Perl Test::More

Expected first:

    Java
    C#
    Ruby
    Pythoscope's generated test methods

I don't have a preference. I simply want to follow a standard that
works well with most tools in Python. Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michał Kwiatkowski  
View profile  
 More options Jan 14 2011, 10:31 am
From: Michał Kwiatkowski <constant.b...@gmail.com>
Date: Fri, 14 Jan 2011 16:31:27 +0100
Local: Fri, Jan 14 2011 10:31 am
Subject: Re: [Pythoscope] Order of arguments to assertEqual: is Pythoscope consistent with the convention in Python?
Hi!

I like assert(expected, actual) because usually expected is a value
(thus short), while actual is a call (longer). Putting expected value
first makes the assertion a bit more readable for me.

Cheers,
mk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »