Skip to content

Commit

Permalink
Various dev fixes (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored Apr 25, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9c115d6 commit e90ba4e
Showing 6 changed files with 14 additions and 19 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -10,14 +10,13 @@ matrix:
- python: "3.6"
- python: "3.7"
dist: xenial
sudo: true # workaround for https://github.com/travis-ci/travis-ci/issues/9815
- python: "pypy"
- python: "pypy3"

cache:
directories:
- stripe-mock
pip: false
pip: true

env:
global:
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -7,10 +7,10 @@ name = "pypi"
stripe = {path = ".",editable = true}

[dev-packages]
pytest = ">=3.4"
pytest-mock = ">=1.7"
pytest-xdist = ">=1.22"
pytest-cov = ">=2.5"
pytest = ">=4.4"
pytest-mock = ">=1.10"
pytest-xdist = ">=1.28"
pytest-cov = ">=2.6"
tox = "*"
"flake8" = "*"
coveralls = "*"
8 changes: 4 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion tests/api_resources/test_ephemeral_key.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ def test_is_creatable(self, request_mock):

def test_is_not_creatable_without_an_explicit_api_version(self):
with pytest.raises(
ValueError, message="stripe_version must be specified"
ValueError, match="stripe_version must be specified"
):
stripe.EphemeralKey.create(customer="cus_123")

10 changes: 4 additions & 6 deletions tests/test_webhook.py
Original file line number Diff line number Diff line change
@@ -81,8 +81,7 @@ def test_raise_on_malformed_header(self):
header = "i'm not even a real signature header"
with pytest.raises(
stripe.error.SignatureVerificationError,
message="Unable to extract timestamp and signatures from "
"header",
match="Unable to extract timestamp and signatures from header",
):
stripe.WebhookSignature.verify_header(
DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET
@@ -92,7 +91,7 @@ def test_raise_on_no_signatures_with_expected_scheme(self):
header = generate_header(scheme="v0")
with pytest.raises(
stripe.error.SignatureVerificationError,
message="No signatures found with expected scheme v1",
match="No signatures found with expected scheme v1",
):
stripe.WebhookSignature.verify_header(
DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET
@@ -102,8 +101,7 @@ def test_raise_on_no_valid_signatures_for_payload(self):
header = generate_header(signature="bad_signature")
with pytest.raises(
stripe.error.SignatureVerificationError,
message="No signatures found matching the expected signature "
"for payload",
match="No signatures found matching the expected signature for payload",
):
stripe.WebhookSignature.verify_header(
DUMMY_WEBHOOK_PAYLOAD, header, DUMMY_WEBHOOK_SECRET
@@ -113,7 +111,7 @@ def test_raise_on_timestamp_outside_tolerance(self):
header = generate_header(timestamp=int(time.time()) - 15)
with pytest.raises(
stripe.error.SignatureVerificationError,
message="Timestamp outside the tolerance zone",
match="Timestamp outside the tolerance zone",
):
stripe.WebhookSignature.verify_header(
DUMMY_WEBHOOK_PAYLOAD,

0 comments on commit e90ba4e

Please sign in to comment.