Our great sponsors
-
pyenv-win
pyenv for Windows. pyenv is a simple python version management tool. It lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
What made this weird was the inconsistency between *NIX and Windows systems. On Windows the Python Launcher is used. This allows you to switch between different Python versions which are registered in the Windows Registry via PEP514 logic. Unfortunately, one of the popular implementations, PyPy, didn't have great support for it. On *NIX systems pyenv made this easy, while on Windows pyenv-win exists but it's currently not able to pull the PyPy mirrors. I wanted a more simplistic way to integrate PyPy into Windows for easy Python Launcher integration. So I started to do something really crazy: write Powershell.
This is the fun that is Powershell mocking, or at least the form that someone completely new to Powershell would write. One thing I must say is that Pester's mocking capabilities are quite easy to work with. It reminded me of pytest mock patching, only well, simpler. Most of the time spent fighting tests was due to the nuances of pipeline flow. For example, you can see that your mocked method was called X many times through something like this:
While I had a small bit of Powershell experience I didn't really take it to the full extent. It was mostly done on an as-needed basis. This time though I decided to really take a stab at things. One thing I find interesting is that Powershell feels like more of the UNIX philosophy of gluing commands together than most of what I've done on Linux systems (shove things into a bash script). Even more weird is Powershell being open source. With that said I began my journey with this empty repository. That's because I'm trying to get that sweet code coverage:
While I had a small bit of Powershell experience I didn't really take it to the full extent. It was mostly done on an as-needed basis. This time though I decided to really take a stab at things. One thing I find interesting is that Powershell feels like more of the UNIX philosophy of gluing commands together than most of what I've done on Linux systems (shove things into a bash script). Even more weird is Powershell being open source. With that said I began my journey with this empty repository. That's because I'm trying to get that sweet code coverage: