Skip to content

Instantly share code, notes, and snippets.

@RonnyPfannschmidt
Forked from DasIch/gist:4408054
Last active December 10, 2015 08:38
Show Gist options
  • Save RonnyPfannschmidt/4408514 to your computer and use it in GitHub Desktop.
Save RonnyPfannschmidt/4408514 to your computer and use it in GitHub Desktop.
# coding: utf-8
import pytest
import os
import random
@pytest.fixture(params=xrange(10))
def password():
return os.urandom(random.randrange(6, 10)).encode("hex")
@pytest.fixture
def pw_hash(password):
return hash(password)
def test_verify_pw_hash(pw_hash, password):
assert pw_hash == hash(password), "%r != hash(%r)" % (pw_hash, password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment