Skip to content

Instantly share code, notes, and snippets.

View hkage's full-sized avatar
🐒

Henning Kage hkage

🐒
View GitHub Profile
@hkage
hkage / git-flake
Created January 25, 2018 11:21
Bash command to make a flake8 check for lokal git changes
#!/bin/bash
if [[ ! -d .git ]]; then
echo "This command must be run from the root directory of a git repository."
exit 1
fi
COMPARE_BRANCH="${1:-development}"
echo "Checking files that have changed between current branch and $COMPARE_BRANCH:"
@hkage
hkage / pytest-cheatsheet.rst
Last active September 2, 2018 15:42
Cheatsheet for pytest features

pytest Cheatsheet

@pytest.fixture

  • scope: the scope for which this fixture is shared, one of “function” (default), “class”, “module”, “session”.
  • params: an optional list of parameters which will cause multiple invocations of the fixture function and all of the tests using it.
  • autouse: if True, the fixture func is activated for all tests that can see it. If False (the default) then an explicit reference is needed to activate the fixture.
  • ids: list of string ids each corresponding to the params so that they are part of the test id. If no ids are provided they will be generated automatically from the params.