- TDD with python, pytest and vim Setting up
- Getting Started
- pip install pytest
- pip install pytest-xdist
- If you are using Anaconda, pytest should already be installed
- Directory/Folder structure Create a tests folder in your project directory Test data for testing dataframes Name corresponding test files with a test_ infront
- Using VIM
- Open vim <filename> in the root directory
- Enter :vsplit <tests/filename> in vim’s console
- You will get a split window.
- Ctrl-wx to swap columns in the order of preference. I.e. code on left, test on right or vice versa
- Ctrl-ww to switch editing columns
- Using VIM – vsplit CODE TESTS
- Using VIM – vsplit Cursor Here shows where you are editing code testsCtrl-ww
- Run pytest -f -v in the root of your project directory
- Pytest will be watching for any changes in the code or tests.
- Once you save either file, it will re- run all tests automatically
- Frameworks ( Django, Flask, Vue.js, React, Angular, MLFlow, WordPress )
- Community (includes Stackoverflow)
- Cloud platforms
- Compute Power (local machine)
- Scikit-learn, scikit-image
Computer Science. When I was younger, I only played games. I wasn’t intrigued by the machine itself, but I was pretty absorbed into the story. Some of the prominent games I loved
MAC/PC: Thexder, Digger, Hillsfar, Star Wars: – Dark Forces, Jedi Knight, Battlefront, X-Wing, TIE, X-Wing vs TIE – Mechwarrior, Diablo, WoW, Red Alert, Rainbow Six, Call of Duty, Company of Heros.
Sega: Thunderforce, Sonic The Hedgehog, Bareknuckles, Golden Axe
PS3: Metal Gear Solid, Colin McRae, Tekken 4
I wasn’t the usual inspired-by-game to go into Computer Science. I wanted to go into Chemical Engineering, but I changed my mind because I wanted to do something more ‘practical’. You see, I had decided computers are the way of the future and Skynet (Terminator) could be a reality. Sound shallow? Well, that was kind of the inspiration behind me embarking into the world of Computer Science.
In 1999, I started to learn C. A very very basic course on programming. What they didn’t teach me then was how to do that at home. We used Borland to write and compile our code. in 2001, I started learning more in Uni. We used Linux and learnt how to code in Python. This changed my entire thinking again. I was inspired by how easy it was to write a few lines of code to do some task.
In Uni we learnt and used C, Python, Java, Haskell, IDL and PHP. There was a project in all of these languages, no running away. By the end of the 4 years, I was pretty worn out and convinced programming wasn’t a career for me. Fast forward to 2011, about 6 years later. I needed to use some coding skills to automate a task at work. And from there, the hacking started again and it’s become rather addictive.
Here’s my story. 🙂
Next: It’s a great time to be a Software Developer