Skip to content

Instantly share code, notes, and snippets.

View skhomuti's full-sized avatar
🤫
¯\_(ツ)_/¯

Sergey Khomutinin skhomuti

🤫
¯\_(ツ)_/¯
View GitHub Profile
@skhomuti
skhomuti / conftest.py
Created March 24, 2021 09:29
clear attachments
import os
from typing import List
import pytest
from _pytest.nodes import Item
from allure_commons.model2 import TestResult, Attachment
from allure_pytest.listener import AllureListener
def allure_listener(config) -> AllureListener:
@skhomuti
skhomuti / conftest.py
Last active April 26, 2021 11:23
pytest-selenium and allure screenshot integration
import base64
import allure
def pytest_selenium_capture_debug(item, report, extra):
for log_type in extra:
if log_type["name"] == "Screenshot":
content = base64.b64decode(log_type["content"].encode("utf-8"))
allure.attach(content, "Screenshot", attachment_type=allure.attachment_type.PNG)
from typing import Optional
from _pytest.config.argparsing import OptionGroup, Parser
from _pytest.nodes import Item
from _pytest.runner import CallInfo
from allure_commons.reporter import AllureReporter
from allure_pytest.listener import AllureListener
def allure_reporter(config) -> Optional[AllureReporter]:
import pytest
class App:
def create(self):
pass
def cleanup(self):
pass
@skhomuti
skhomuti / check_no_relays.py
Created February 26, 2025 09:24
Check fee recipient on the relays for CSM Node Operators
# pre-requisite: python3, web3, requests
# usage: python3 check_no_relays.py
import os
from json import JSONDecodeError
import requests
from requests.adapters import HTTPAdapter, Retry
from web3 import Web3