def describe_do_run():
@pytest.yield_fixture
def config(tmpdir):
cwd = os.getcwd()
tmpdir.chdir()
with Path(".env").open('w') as f:
f.write("FOO=1")
with Path("app.py").open('w') as f:
f.write("os.getenv('FOO', 2)")
yield Config.new(
sourcefiles=[
SourceFile(".env"),
SourceFile("app.py"),
],
environments=[
Environment("test", command="echo FOO=3"),
],
)
os.chdir(cwd)
def it_returns_table_data(runner, config):
print(config.sourcefiles)
data = do_run(config)
expect(list(data)) == [
['Variable', 'File: .env', 'File: app.py', 'Environment: test'],
['FOO', 'FOO=1', "os.getenv('FOO', 2)", '3'],
]
评论列表
文章目录