fs2 shows file leak
Working on the issue: 'py.test runs with fs2 shows file leak'. Traced the execution path and here is the problem:
-> backend_uri
[Details]
Inside create_simple_mapping we have:
elif backend_uri.startswith(FS2_PREFIX):
....instance_uri = backend_uri[len(FS2_PREFIX):]
....index_uri = 'sqlite:///%s_index.sqlite' % instance_uri
....content, userprofile, trash, router_index_uri = _create_backends(fs2.FS2Backend, instance_uri, index_uri)
In line number '2' of the code i.e. 'instance_uri = backend_uri[len(FS2_PREFIX):]', value of instace_uri becomes an empty string. Now this is passed to _create_backends(fs2.FS2Backend, instance_uri, index_uri) and as a result in _create_backend(BackendClass, backend_uri, index_uri) backend_uri have no value.
Solution: Passing a value from init_test_app(given_config) in conftest.py like 'fs2:temp_uri' serves the purpose.
Note: this is not a solution to the fs2 file leak. You just used the fs url arg wrong and then corrected your mistake.