Skip to content

Instantly share code, notes, and snippets.

View hackebrot's full-sized avatar
💻
Focusing

Raphael Aurich hackebrot

💻
Focusing
View GitHub Profile
@hackebrot
hackebrot / rename
Created August 1, 2016 07:42
rename in files
$ ag -w foo -l -0 | xargs -0 -n 1 sed -i '' -e 's/foo/bar/g'
@hackebrot
hackebrot / new_context.json
Created June 4, 2016 16:22
cookiecutter.json draft
{
"author": "Raphael Pierzina",
"keywords": [
"pytest",
"plugin"
],
"url": "https://github.com/pytest-dev/cookiecutter-pytest-plugin",
"variables": [
{
"default": "Raphael Pierzina",
@hackebrot
hackebrot / conftest.py
Last active February 1, 2016 22:55
pytest magic
def pytest_collection_modifyitems(items, config):
selected_items = []
deselected_items = []
for item in items:
if 'new_fixture' in getattr(item, 'fixturenames', ()):
selected_items.append(item)
else:
deselected_items.append(item)
config.hook.pytest_deselected(items=deselected_items)
@hackebrot
hackebrot / create_tests.sh
Created November 4, 2015 17:13
create pytest tests
#! /usr/bin/env bash
set -e
set -u
set -x
for testdir in foobar hello/world example
do
mkdir -p $testdir
for i in {1..3}
@hackebrot
hackebrot / test_skipif.py
Created November 15, 2014 11:22
py.test skipif reasons
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
first_condition = False
second_condition = True