mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
use tmpdir instead of isolated_filesystem, refs #2037
Should hopefully get tests passing for #2036 too.
This commit is contained in:
parent
bd39cb4805
commit
25fdbe6b27
1 changed files with 5 additions and 6 deletions
|
|
@ -179,14 +179,13 @@ def test_install_upgrade(run_module, flag):
|
|||
|
||||
|
||||
@mock.patch("datasette.cli.run_module")
|
||||
def test_install_requirements(run_module):
|
||||
def test_install_requirements(run_module, tmpdir):
|
||||
path = tmpdir.join("requirements.txt")
|
||||
path.write("datasette-mock-plugin\ndatasette-plugin-2")
|
||||
runner = CliRunner()
|
||||
with runner.isolated_filesystem():
|
||||
with open("requirements.txt", "w") as fp:
|
||||
fp.write("datasette-mock-plugin\ndatasette-plugin-2")
|
||||
runner.invoke(cli, ["install", "-r", "requirements.txt"])
|
||||
runner.invoke(cli, ["install", "-r", str(path)])
|
||||
run_module.assert_called_once_with("pip", run_name="__main__")
|
||||
assert sys.argv == ["pip", "install", "-r", "requirements.txt"]
|
||||
assert sys.argv == ["pip", "install", "-r", str(path)]
|
||||
|
||||
|
||||
def test_install_error_if_no_packages():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue