Open in app

Sign In

Write

Sign In

Ivan Georgiev
Ivan Georgiev

18 Followers

Home

About

Oct 21, 2022

Python Class Decorator Primer — Class Instance Registry

This article is originally published on my mini-blog: Python Class Decorator Primer — Class Instance Registry. For up-to date information refer to the original publication. Let’s assume we have a situation where we need to keep track about eache instance of a class. The source code used in this document…

Python

1 min read

Python

1 min read


Sep 25, 2022

Event-Driven Python with pypubsub

Simple Event Driven Python Example — Explained We will use a fictious ordering system to demonstrate the implementation of event-driven system in Python. We need to implement a workflow with following steps: 1. Order is placed by a customer 2. Order is created by persisting it to the database 3. …

Python

5 min read

Python

5 min read


Dec 28, 2021

Take a screenshot in Python, using Selenium

Selenium driver has save_screenshot() method which saves a screenshot of the browser viewable area to an image file. Let’s try taking a screenshot by example: Open the http://igeorgiev.eu web page. Save a screenshot from the page to a file. URL = "https://igeorgiev.eu" with contextlib.closing(webdriver.Chrome()) as driver: driver.get(URL) driver.save_screenshot(str(SCREENSHOTS_DIR / "igeorgiev-home.png"))

Python

2 min read

Take a screenshot in Python, using Selenium
Take a screenshot in Python, using Selenium
Python

2 min read


Dec 26, 2021

Passing context across steps with pytest-bdd

Behave framework uses generic catch-them-all context to maintain state across test steps. Many newcomers to the pytest and pytest-bdd world are wondering how to do the same with pytest-bdd. Read further to find how. Pytest-bdd is a pytest plugin. This makes it possible to use pytest fixture to maintain state…

Python

2 min read

Passing context across steps with pytest-bdd
Passing context across steps with pytest-bdd
Python

2 min read


Nov 30, 2021

Test HTTP and API interactions with vcrpy

Background We have a simple PeopleRepository class which we are going to use to interact with the Star Wars API. The repository class implements two methods: MethodPurposeall()Return a list of all people from Star Warsfind(**filter)Return a list of all people from Star Wars who match the given filter. Interaction with the…

Python

2 min read

Python

2 min read


Nov 29, 2021

How to execute unit tests before commit or push to git?

The term “shift left” refers to a practice in software development in which teams focus on quality, work on problem prevention instead of detection, and begin testing as early as possible. …

Git

2 min read

Git

2 min read


May 15, 2021

How to Migrate a Git Repository

Sometimes you need to migrate an existing Git repository into a new repository. The migration needs to guarantee that the full commit history, branches, etc. is preserved. In a blob post I provided a recipe on how to migrate Git repository and preserve the full commit history, branches, etc. Here…

Git

2 min read

How to Migrate a Git Repository
How to Migrate a Git Repository
Git

2 min read


May 4, 2021

Working with SecureString in PowerShell

Create SecureString There are many ways for creating SecureString . Most often we need to create SecureString : From plain-text String From host input There are other ways or sources of SecureString , e.g. …

Powershell

2 min read

Working with SecureString in PowerShell
Working with SecureString in PowerShell
Powershell

2 min read


Apr 23, 2021

Connect to a SQL Database from Python using access token

Connecting to a database using username and password is very convenient and easy. There are situations where we have a restriction to use token from Active Directory or Azure Active Directory. Here is a Python function which you can be used to connect to a SQL Database using access token…

Python

2 min read

Python

2 min read


Nov 3, 2020

Update Databricks Environment Variables Remotely

You have Databricks instance and you need to be able to configure the environment variables for the Databricks cluster in automated way. For example from a CI/CD pipeline. Databrick CLI Databricks CLI provides an interface to Databricks REST APIs. You can find more information on Databricks CLI documentation page. Let’s do some…

Spark

3 min read

Spark

3 min read

Ivan Georgiev

Ivan Georgiev

18 Followers

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech