Writing Tests For Your Python Project

I began this little trip with the post Exporting CloudWatch Logs to S3 that provided example code to get logs from Cloud Watch to S3. From there, the code got prettier with Adding pre-commit Hooks to Python Repo. The next logical step is to make sure the code functions exactly like we’d expect. This can be done by writing tests to make sure our code functions like we’d expect. I’ve highlighted a number of reasons why you should create tests in the article Top 5 Reasons to Build Tests for Your Code. ...

January 20, 2023 · 5 min · Scott

Top 5 Reasons to Build Tests for Your Code

As a Python developer, it’s important to make sure that your code is working correctly and efficiently. One way to do this is by building tests for your code. In this blog post, we’ll go over the top reasons why you should build tests for your Python code. Improved Quality One of the main benefits of building tests for your code is that it helps improve the quality of your code. When you write tests, you are effectively creating a set of requirements for your code to meet. This helps ensure that your code is doing what it’s supposed to do, and it helps catch any issues early on in the development process. ...

January 13, 2023 · 2 min · Scott

5 Common Reasons To Use Pre-commit Hooks in Your Python Project

Pre-commit hooks are scripts that run automatically before a commit is made. In my post Adding pre-commit Hooks to Python Repo, I explained how to configure pre-commit hooks in your repo and address the issues identified by them. After understanding how to setup these hooks, the next question is what hooks should I use and why? Here are five common reasons to use pre-commit hooks for Python and some example plugins that you can use for each reason. ...

January 6, 2023 · 5 min · Scott

Successfully Deploying a Static WordPress Site

If you’ve followed my previous posts, you’ll see that I’ve spent some time attempting to build my blog on WordPress and then finally make it static. This had resulted in lots of custom code and even more failed attempts to get things to publish correctly. I’ve finally been successful in building out my site with a combination of some of my failed attempts: Adding Nginx in Front of WordPress Building a Kubernetes Container That Synchs with Private Git Repo Building a Static WordPress The third article above is the most failed attempt to date at making the WordPress site static because it resulted in just as many successes as it did failures. The good news is that I learned a lot along the way on this particular attempt and it brought me to what appears to be a functional static site. ...

November 17, 2022 · 6 min · Scott

Adding pre-commit Hooks to Python Repo

Writing code can be tough and writing clean code can be even more difficult some times. When you get on a roll and put together highly functional and imaginative code, it might not always look the greatest. Also, when crunched for time, it can be very difficult to go back over the code and attempt to make it as pretty as possible. You might also need to make sure other files used by your code are also formatted properly. Next, add in multiple developers, and you’ve got yourself something that can grow uglier over time. Much of these issues can be addressed by using <a href="https://pre-commit.com/" rel="noreferrer noopener" target="_blank">pre-commit</a> hooks in your Python code’s github repo. ...

November 6, 2022 · 10 min · Scott