-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving app engine samples to py.test
- Loading branch information
Jon Wayne Parrott
committed
Feb 22, 2016
1 parent
11cbbfd
commit 6990555
Showing
25 changed files
with
466 additions
and
576 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
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
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,3 +1,4 @@ | ||
import pytest | ||
import testing.appengine | ||
|
||
|
||
|
@@ -7,3 +8,28 @@ def pytest_configure(config): | |
|
||
def pytest_runtest_call(item): | ||
testing.appengine.import_appengine_config() | ||
|
||
|
||
@pytest.yield_fixture | ||
def testbed(): | ||
testbed = testing.appengine.setup_testbed() | ||
yield testbed | ||
testbed.deactivate() | ||
|
||
|
||
@pytest.fixture | ||
def login(testbed): | ||
def _login(email='[email protected]', id='123', is_admin=False): | ||
testbed.setup_env( | ||
user_email=email, | ||
user_id=id, | ||
user_is_admin='1' if is_admin else '0', | ||
overwrite=True) | ||
return _login | ||
|
||
|
||
@pytest.fixture | ||
def run_tasks(testbed): | ||
def _run_tasks(app): | ||
testing.appengine.run_tasks(testbed, app) | ||
return _run_tasks |
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
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
Oops, something went wrong.