Aggregator

Tor's Strength in Numbers Campaign, New ask.krita.org Site, Kodi Announces Limited-Edition Raspberry Pi Case, IPFire 2.21 Core Update 125 Released, and Chrome and Firefox Developers Plan to End Support for FTP

2 weeks 6 days ago

News briefs for November 27, 2018.

Tor announces its Strength in Numbers campaign: "Stand up for the universal human rights to privacy and freedom and help keep Tor robust and secure." For #GivingTuesday, another donor will match first-time donations to the project—this is in addition to the existing matching donations from Mozilla, so if you donate, your gift will be matched twice. Go here to donate.

Scott Petrovic and the KDE sysadmin team have launched ask.krita.org—the "Krita Question and Answers Site". The new ask.krita.org "is a place where it's simple to find out if your question has been asked before, simple to ask a question, and simple to answer a question. It's a central place where, we hope, Krita users will get together and help each other. Like a stackoverflow site, or like ask.libreoffice.org.

Kodi recently released a new limited-edition "Kodi Edition" Raspberry Pi case. This version 2 of the case Kodi released two years ago is newly designed, aluminum, but it's "now gone to the dark side with a metallic, jet black coating for that cool Vader look". In addition, "the second-generation case features better access to the SD card, a better built-in heatsink, precision manufacturing, and subtle details that make a great case amazing." A percentage of every sale of this case goes to the USC Norris Comprehensive Cancer Center. You can order one from FLIRC for $19.95.

IPFire 2.21 Core Update 125 was released yesterday. This update has various bug and security fixes, along with new features, such as "the IPFire Access Point add-on now supports 802.11ac WiFi if the chipset supports it" and the dehydrated "lightweight client to retrieve certificates from Let's Encrypt written in bash". You can download it from here.

Chrome and Firefox developers plan to end support for FTP. BleepingComputer reports that "an upcoming change in how files stored on FTP servers are rendered in the browser may be the first step in its ultimate removal", and also that "Google developers have advocated for the removal of FTP support in Chrome for over 4 years" due to its low usage and the additional attack surface it creates that Chrome is unable to secure properly, compared to offering the same files over an HTTPS connection.

News Tor KDE Krita Raspberry Pi Kodi IPFire Chrome Firefox Security
Jill Franklin

Testing Your Code with Python's pytest

2 weeks 6 days ago
by Reuven M. Lerner

Don't test your code? pytest removes any excuses.

Software developers don't just write software; they also use software. So, they're the first to recognize, and understand, that software is complex and inevitably contains bugs.

But, just because bugs are inevitable doesn't mean that developers can or should try to prevent them. And, thus, during the past few decades, there's been rapid growth in software testing. Testing is no longer seen as an optional or "nice to have" part of software development; it's considered an absolute must—part of the software development process. In many cases, the people in the Python courses I teach at various companies aren't developers per se, but instead testers—people with the full-time job of writing tests to ensure that the company's software is robust.

I must admit that even though I've been writing software for a long time, I have rarely been as good about testing as I'd like to be. Sure, when I'm working on a large, complex app, I'll write tests, but it always seemed to be a bit of a burden. I know that it's good for me, will save tons of time in the future, will make the software more robust and maintenance easier, but really, if I just want to get my program out the door, why test? And besides, the various test frameworks I've used through the years never struck me as very impressive or easy to use.

So for the past few years, I've been in a bit of a holding pattern. I want to test more, but testing is annoying, so I don't test, which makes it seem like even more of a burden, because it's not part of my regular process.

All of this has changed for me recently, thanks to my discovery (long after other people, I admit) of the pytest library for Python. pytest turns out to be easy to use, easy to work with and easy to integrate into my work. Part of the reason for this is that pytest abandons the Python idea of "there's only one way to do it", giving developers a great degree of flexibility and freedom in choosing how to write tests.

So in this article, I provide an introduction to pytest, showing how to start integrating it into your development process today. I plan to expand on this in my next article and describe some more advanced pytest features that you might need to use.

Basic pytest

The idea behind pytest is that if you want to test a function, you'll write a separate function to test it. Actually, you'll probably want to write more than one test function, but that's in addition.

For example, let's assume you have the following function that sums numbers:

Go to Full Article
Reuven M. Lerner