This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import pytest | |
first_condition = False | |
second_condition = True | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"author": "Raphael Pierzina", | |
"keywords": [ | |
"pytest", | |
"plugin" | |
], | |
"url": "https://github.com/pytest-dev/cookiecutter-pytest-plugin", | |
"variables": [ | |
{ | |
"default": "Raphael Pierzina", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ag -w foo -l -0 | xargs -0 -n 1 sed -i '' -e 's/foo/bar/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import random | |
import pytest | |
@pytest.hookimpl(hookwrapper=True) | |
def pytest_runtest_makereport(item): | |
outcome = yield | |
rep = outcome.get_result() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elif call.when == "call": | |
strict_default = item.config.getini('xfail_strict') | |
is_strict_xfail = evalxfail.get('strict', strict_default) | |
# TODO: xpass outcome | |
if is_strict_xfail: | |
rep.outcome = "failed" | |
else: | |
rep.outcome = "passed" | |
rep.wasxfail = evalxfail.getexplanation() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.hookimpl(hookwrapper=True) | |
def pytest_runtest_makereport(item, call): | |
outcome = yield | |
rep = outcome.get_result() | |
if pytest.config.getoption('--error-for-skips'): | |
if rep.skipped and call.excinfo.errisinstance(pytest.skip.Exception): | |
rep.outcome = 'failed' | |
r = call.excinfo._getreprcrash() | |
rep.longrepr = 'Skipped test - {message}'.format(message=r.message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addprx = "!f() { b=`git symbolic-ref -q --short HEAD` && \ | |
echo \"Making branch for pull request #$1 [pr/$1]\" && \ | |
git fetch origin pull/$1/head:pr/$1 && \ | |
echo \"Rebasing pr/$1 onto $b...\" && \ | |
git fetch -q -f origin pull/$1/merge:refs/PR_MERGE_HEAD && \ | |
git rebase -q --onto $b PR_MERGE_HEAD^ pr/$1 && \ | |
git checkout -q $b && echo && \ | |
git diff --stat $b..pr/$1 && echo && \ | |
git log --oneline $b..pr/$1; \ | |
git update-ref -d refs/PR_MERGE_HEAD; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DEFAULT_GOAL := help | |
define filterstdlib | |
go list -f '{{ if not .Standard }}{{ .ImportPath }}{{ end }}' | |
endef | |
define getimports | |
go list -f '{{ join .Imports "\n" }}' | |
endef |
OlderNewer