Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Expert Python Programming

You're reading from   Expert Python Programming Write professional, efficient and maintainable code in Python

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785886850
Length 536 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Michał Jaworski Michał Jaworski
Author Profile Icon Michał Jaworski
Michał Jaworski
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Current Status of Python 2. Syntax Best Practices – below the Class Level FREE CHAPTER 3. Syntax Best Practices – above the Class Level 4. Choosing Good Names 5. Writing a Package 6. Deploying Code 7. Python Extensions in Other Languages 8. Managing Code 9. Documenting Your Project 10. Test-Driven Development 11. Optimization – General Principles and Profiling Techniques 12. Optimization – Some Powerful Techniques 13. Concurrency 14. Useful Design Patterns Index

I do test

If you are coming from the I don't test section and are now convinced to do test-driven development, then congratulations! You know the basics of test-driven development, but there are some more things you should learn before you will be able to efficiently use this methodology.

This section describes a few problems developers bump into when they write tests and some ways to solve them. It also provides a quick review of popular test runners and tools available in the Python community.

unittest pitfalls

The unittest module was introduced in Python 2.1 and has been massively used by developers since then. But some alternative test frameworks were created in the community by people who were frustrated with the weaknesses and limitations of unittest.

These are the common criticisms that are often made:

  • The framework is heavy to use because:
    • You have to write all your tests in subclasses of TestCase
    • You have to prefix the method names with test
    • You are encouraged to use assertion methods...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image