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

assertTrue or assertIn #19

Closed
AndreaCrotti opened this issue May 31, 2014 · 1 comment
Closed

assertTrue or assertIn #19

AndreaCrotti opened this issue May 31, 2014 · 1 comment

Comments

@AndreaCrotti
Copy link
Contributor

In chapter04 (I tried to comment directly in the code but the asciidoc doesn't let me by the way) there is this:

    self.assertTrue(any(row.text) == '1: Buy peacock feathers' for row in rows)

It might be also written like this I think, which would be even easier adding another variable for the text in the rows.

 self.assertIn('Buy peacock feathers', [row.text for row in rows])
@hjwp
Copy link
Owner

hjwp commented May 31, 2014

Keep reading Andrea. We change this later. --Sent from my BlackBerry. That's right, a phone with a real keyboard. Forget this decade, I'm off back to the naughties.Harry | 07887702511 | @hjwp From: Andrea CrottiSent: Saturday, 31 May 2014 10:05To: hjwp/Book-TDD-Web-Dev-PythonReply To: hjwp/Book-TDD-Web-Dev-PythonSubject: [Book-TDD-Web-Dev-Python] assertTrue or assertIn (#19)In chapter04 (I tried to comment directly in the code but the asciidoc doesn't let me by the way) there is this:

self.assertTrue(any(row.text) == '1: Buy peacock feathers' for row in rows)

It might be also written like this I think, which would be even easier adding another variable for the text in the rows.

self.assertIn('Buy peacock feathers', [row.text for row in rows])

—Reply to this email directly or view it on GitHub.

@hjwp hjwp closed this as completed May 31, 2014
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

No branches or pull requests

2 participants