Skip to content

Instantly share code, notes, and snippets.

class NodeFactory(object):
@staticmethod
def create(node_type):
if node_type == 'SANode':
return SANode
else:
return Node
import pytest
from collections import OrderedDict
from pprint import pprint
@pytest.hookimpl(trylast=True)
def pytest_collection_modifyitems(session, config, items):
"""
Create an ordered dict containing clustered tests based on classes
@magixx
magixx / docker_names.py
Last active May 3, 2021 20:17
Docker Container Names in Python
"""
https://github.com/docker/docker/blob/master/pkg/namesgenerator/names-generator.go
"""
from random import choice
ADJECTIVES=["admiring","adoring","affectionate","agitated","amazing","angry","awesome","blissful","boring","brave","clever","cocky","compassionate","competent","condescending","confident","cranky","dazzling","determined","distracted","dreamy","eager","ecstatic","elastic","elated","elegant","eloquent","epic","fervent","festive","flamboyant","focused","friendly","frosty","gallant","gifted","goofy","gracious","happy","hardcore","heuristic","hopeful","hungry","infallible","inspiring","jolly","jovial","keen","kickass","kind","laughing","loving","lucid","mystifying","modest","musing","naughty","nervous","nifty","nostalgic","objective","optimistic","peaceful","pedantic","pensive","practical","priceless","quirky","quizzical","relaxed","reverent","romantic","sad","serene","sharp","silly","sleepy","stoic","stupefied","suspicious","tender","thirsty","trusting","unruffled","upbeat","vibrant","vigilant","w