Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to pytest based tests and make use of multiple CPUs
From what I’ve seen the average test time is down to about 20% of what the old test suite took to run.
- Loading branch information
1 parent
4eed74f
commit 4f2b819
Showing
10 changed files
with
726 additions
and
448 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
language: python | ||
python: | ||
- "2.6" | ||
- "2.7" | ||
- "3.4" | ||
- "3.5" | ||
|
||
install: "pip install -r requirements.txt" | ||
matrix: | ||
include: | ||
- python: 2.6 | ||
env: | ||
- TOXENV='py26' | ||
- python: 2.7 | ||
env: | ||
- TOXENV='py27' | ||
- python: 3.3 | ||
env: | ||
- TOXENV='py33' | ||
- python: 3.5 | ||
env: | ||
- TOXENV='py35' | ||
- python: 3.5 | ||
env: | ||
- TOXENV='lint' | ||
|
||
script: python setup.py test | ||
install: | ||
- pip install tox | ||
|
||
script: tox |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import pytest | ||
import sendwithus | ||
|
||
|
||
@pytest.fixture | ||
def api_key(): | ||
return 'THIS_IS_A_TEST_API_KEY' | ||
|
||
|
||
@pytest.fixture | ||
def api_options(): | ||
return {'DEBUG': False} | ||
|
||
|
||
@pytest.fixture | ||
def api(api_key, api_options): | ||
return sendwithus.api(api_key, **api_options) | ||
|
||
|
||
@pytest.fixture | ||
def email_id(): | ||
return 'test_fixture_1' | ||
|
||
|
||
@pytest.fixture | ||
def email_address(): | ||
return 'person@example.com' | ||
|
||
|
||
@pytest.fixture | ||
def segment_id(): | ||
return 'seg_VC8FDxDno9X64iUPDFSd76' | ||
|
||
|
||
@pytest.fixture | ||
def enabled_drip_campaign_id(): | ||
return 'dc_Rmd7y5oUJ3tn86sPJ8ESCk' | ||
|
||
|
||
@pytest.fixture | ||
def disabled_drip_campaign_id(): | ||
return 'dc_AjR6Ue9PHPFYmEu2gd8x5V' | ||
|
||
|
||
@pytest.fixture | ||
def drip_campaign_step_id(): | ||
return 'dcs_yaAMiZNWCLAEGw7GLjBuGY' | ||
|
||
|
||
@pytest.fixture | ||
def recipient(): | ||
return { | ||
'name': 'Matt', | ||
'address': 'us@sendwithus.com' | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def email_data(): | ||
return { | ||
'name': 'Jimmy', | ||
'plants': ['Tree', 'Bush', 'Shrub'] | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def sender(): | ||
return { | ||
'name': 'Company', | ||
'address': 'company@company.com', | ||
'reply_to': 'info@company.com' | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def cc_test(): | ||
return [ | ||
{ | ||
'name': 'Matt CC', | ||
'address': 'test+cc@sendwithus.com' | ||
} | ||
] | ||
|
||
|
||
@pytest.fixture | ||
def bcc_test(): | ||
return [ | ||
{ | ||
'name': 'Matt BCC', | ||
'address': 'test+bcc@sendwithus.com' | ||
} | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.