File: accessories.py

package info (click to toggle)
sqlitedict 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 200 kB
  • sloc: python: 825; makefile: 31; sh: 7
file content (11 lines) | stat: -rw-r--r-- 302 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
"""Accessories for test cases."""
import os


def norm_file(fname):
    """Normalize test filename, creating a directory path to it if necessary"""
    fname = os.path.abspath(fname)
    dirname = os.path.dirname(fname)
    if not os.path.exists(dirname):
        os.makedirs(dirname)
    return fname