Setting up test cases for code that manage data can be challenging but it’s an important skill to reliably test your code. You might have heard of the setup and teardown methods in unittest. In pytest you use fixtures and as you will discover in this article they are actually not that hard to set up. Fixtures have been labelled pytest’s killer feature so let’s explore them in this article using a practical example.
Articles on refactoring
Code Challenge 35 – Improve Your Python Code With BetterCodeHub – Review
By PyBites Team on 11 September 2017
In this article we review last week’s Improve Your Python Code With BetterCodeHub code challenge.
Code Challenge 35 – Improve Your Python Code With BetterCodeHub
By PyBites Team on 5 September 2017
Hi Pythonistas, a new week, a new ‘bite’ of Python programming! Last week we wrote an article on improving the quality of your code with Better Code Hub. This week we let you refactor a Python project. You can even win awards thanks to SIG who is sponsoring this challenge!
Improve the Quality of Your Code with Better Code Hub
By Bob Belderbos on 30 August 2017
So you pushed your code to GitHub and deployed v1, congrats! But how maintainable is your code really? Do you have tests? Is your code modular? Are your methods short and concise? What if you could hit a button and a tool conveniently checks this for you? Free and integrated with GitHub? Enter Better Code Hub from Software Improvement Group …
Using Pillow to Create Nice Banners For Your Site
By Bob Belderbos on 11 August 2017
Running your site or business good chance you A. use promo material like banners and B. you make them manually with Photoshop, Gimp or what not. And yes for anything beyond the basics you probably need those programs. But what if you like to keep it simple and want to semi-automate things? Just an image and text on canvas? Enter Pillow – The friendly PIL fork, which makes this pretty easy. Come explore some of its capabilities with me in this article.
Code Challenge 30 – The Art of Refactoring: Improve Your Code – Review
By PyBites Team on 7 August 2017
In this article we review last week’s The Art of Refactoring: Improve Your Code code challenge. We’re excited to have done 30 challenges so far and it feels like we only got started. Prepare for more to come!
Code Challenge 30 – The Art of Refactoring: Improve Your Code
By PyBites Team on 1 August 2017
Hi Pythonistas, a new week, a new ‘bite’ of Python coding. Wow challenge 30 already! This week we let you hone your refactoring skills. Learn, code, PR submit (don’t be shy) and above all have fun!
The Importance of Refactoring Code
By Julian Sequeira on 13 July 2017
In this quick post I discuss why refactoring code is one of the most important parts of the learning process.
From Script to Project – Packaging Your Code in Python
By Bob Belderbos on 1 July 2017
This week’s article is about packaging your Python code. Sounds daunting? Actually it is pretty simple.
OOP Beyond the Basics: Using Properties for Encapsulation, Computation and Refactoring
By Bob Belderbos on 31 May 2017
In this article I share my learning of the property decorator coding a simple Account class. I think it’s an unmissable tool in your (Python) OOP toolkit.