Skip to content

Instantly share code, notes, and snippets.

@SRomansky
Created October 1, 2014 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SRomansky/406b582c2c995f86ccaf to your computer and use it in GitHub Desktop.
Save SRomansky/406b582c2c995f86ccaf to your computer and use it in GitHub Desktop.
tmpdir error
tmpdir = local('/tmp/pytest-6/test_query_result_types0')
@pytest.fixture
def db(tmpdir):
profile_path = tmpdir.mkdtemp()
profile = Profile(profile_path, 'testing')
> return profile.get_database()
freeseer/tests/framework/test_db_pytest.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <freeseer.framework.config.profile.Profile object at 0x7ff4db0f49d0>
name = 'presentations.db'
def get_database(self, name='presentations.db'):
"""Returns an instance of QtDBConnector for a specific database file.
It is also cached for future gets.
"""
if name not in self._databases:
> self._databases[name] = QtDBConnector(self.get_filepath(name), PluginManager(self))
freeseer/framework/config/profile.py:130:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <freeseer.framework.config.profile.Profile object at 0x7ff4db0f49d0>
name = 'presentations.db'
def get_filepath(self, name):
"""Returns the absolute path for a file called name.
The filepath will be prefixed with the profile's base folder.
"""
> return os.path.join(self._folder, name)
freeseer/framework/config/profile.py:83:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = local('/tmp/tmp4OS3rm'), p = ('presentations.db',)
path = local('/tmp/tmp4OS3rm'), b = 'presentations.db'
def join(a, *p):
"""Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
ends with a separator."""
path = a
for b in p:
if b.startswith('/'):
path = b
> elif path == '' or path.endswith('/'):
E AttributeError: 'LocalPath' object has no attribute 'endswith'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment