-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
setup_module | ||
|
||
setup_function | ||
test_one | ||
42 | ||
setup_module: <TemporaryDirectory '/tmp/tmp18kxxqva'> | ||
setup_function <TemporaryDirectory '/tmp/tmp_bd8lazj'> | ||
test_one <TemporaryDirectory '/tmp/tmp18kxxqva'> <TemporaryDirectory '/tmp/tmp_bd8lazj'> | ||
test_one after | ||
teardown_function | ||
|
||
setup_function | ||
test_two | ||
teardown_function | ||
|
||
setup_function | ||
test_three | ||
teardown_function <TemporaryDirectory '/tmp/tmp_bd8lazj'> | ||
setup_function <TemporaryDirectory '/tmp/tmp9k2cbqcb'> | ||
test_two <TemporaryDirectory '/tmp/tmp18kxxqva'> <TemporaryDirectory '/tmp/tmp9k2cbqcb'> | ||
teardown_function <TemporaryDirectory '/tmp/tmp9k2cbqcb'> | ||
setup_function <TemporaryDirectory '/tmp/tmp5u8n90cx'> | ||
test_three <TemporaryDirectory '/tmp/tmp18kxxqva'> <TemporaryDirectory '/tmp/tmp5u8n90cx'> | ||
test_three after | ||
teardown_function | ||
teardown_function <TemporaryDirectory '/tmp/tmp5u8n90cx'> | ||
teardown_module <TemporaryDirectory '/tmp/tmp18kxxqva'> | ||
|
||
teardown_module | ||
42 |
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,34 +1,34 @@ | ||
import tempfile | ||
|
||
def setup_module(): | ||
global db | ||
db = tempfile.TemporaryDirectory() | ||
print(f"setup_module: {db}") | ||
global db_server | ||
db_server = tempfile.TemporaryDirectory() | ||
print(f"setup_module: {db_server}") | ||
|
||
def teardown_module(): | ||
print("teardown_module") | ||
print(db) | ||
print(f"teardown_module {db_server}") | ||
|
||
|
||
def setup_function(): | ||
print(" setup_function") | ||
global db | ||
db = tempfile.TemporaryDirectory() | ||
print(f" setup_function {db}") | ||
|
||
def teardown_function(): | ||
print(" teardown_function") | ||
print(f" teardown_function {db}") | ||
|
||
|
||
def test_one(): | ||
print(" test_one") | ||
print(db) | ||
print(f" test_one {db_server} {db}") | ||
assert True | ||
print(" test_one after") | ||
|
||
def test_two(): | ||
print(" test_two") | ||
print(f" test_two {db_server} {db}") | ||
assert False | ||
print(" test_two after") | ||
|
||
def test_three(): | ||
print(" test_three") | ||
print(f" test_three {db_server} {db}") | ||
assert True | ||
print(" test_three after") |
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,13 +1,17 @@ | ||
$ pytest -qqs test_functions.py | ||
|
||
setup_db <TemporaryDirectory '/tmp/tmppjc3h7k2'> | ||
test_one <TemporaryDirectory '/tmp/tmppjc3h7k2'> | ||
setup db_server | ||
new db_serverironment | ||
setup_db <TemporaryDirectory '/tmp/tmpsqk01wqt'> | ||
test_one <TemporaryDirectory '/tmp/tmpsqk01wqt'> | ||
test_one after | ||
teardown_db <TemporaryDirectory '/tmp/tmppjc3h7k2'> | ||
setup_db <TemporaryDirectory '/tmp/tmp_0j_gnnb'> | ||
test_two <TemporaryDirectory '/tmp/tmp_0j_gnnb'> | ||
setup_db <TemporaryDirectory '/tmp/tmpl3gvod_3'> | ||
test_three <TemporaryDirectory '/tmp/tmpl3gvod_3'> | ||
teardown_db <TemporaryDirectory '/tmp/tmpsqk01wqt'> | ||
setup db_server | ||
setup_db <TemporaryDirectory '/tmp/tmp8qyhchd6'> | ||
test_two <TemporaryDirectory '/tmp/tmp8qyhchd6'> | ||
setup db_server | ||
setup_db <TemporaryDirectory '/tmp/tmpu4ei9yc5'> | ||
test_three <TemporaryDirectory '/tmp/tmpu4ei9yc5'> | ||
test_three after | ||
teardown_db <TemporaryDirectory '/tmp/tmpl3gvod_3'> | ||
teardown_db <TemporaryDirectory '/tmp/tmpu4ei9yc5'> | ||
|
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