コード例 #1
0
ファイル: test_app.py プロジェクト: szabgab/slides
def test_again():
    res = app.do_something()  # it is still test_1.json
    ...
コード例 #2
0
ファイル: test_app.py プロジェクト: szabgab/slides
def test_app():
    app.data_file = 'test_1.json'  # manually overwrite

    res = app.do_something()  # it is now test_1.json
    ...
コード例 #3
0
def test_again():
    res = app.do_something() # back to the original value
    ...
コード例 #4
0
def test_sum(monkeypatch):
    monkeypatch.setattr(app, 'data_file', 'test_1.json')

    res = app.do_something()    # It is now test_1.json
    ...
コード例 #5
0
def test_sum(monkeypatch, tmpdir):
    fake_file = tmpdir.join('test_1.json')
    monkeypatch.setattr(app, 'data_file', fake_file)

    res = app.do_something()
    ...
コード例 #6
0
ファイル: fetch.py プロジェクト: henriklarsson/bridge
import app

app.do_something()
コード例 #7
0
def test_something():
    assert do_something()