Avoid file locking issue when running CLI test (#6449)

__file__ will resolve to tests/test_cli.py, which is already opened by Python.
When tests are run on a network file system the test runner may deadlock while
waiting for an advisory lock to be released on this file.
This commit is contained in:
Eric Radman
2023-09-12 18:44:24 -04:00
committed by GitHub
parent 6d91c64dae
commit ff85a36f50

View File

@@ -132,7 +132,7 @@ class DataSourceCommandTests(BaseTestCase):
self.factory.create_data_source(
name="test1",
type="sqlite",
options=ConfigurationContainer({"dbpath": __file__}),
options=ConfigurationContainer({"dbpath": "/notexist.db"}),
)
runner = CliRunner()
result = runner.invoke(manager, ["ds", "test", "test1"])