A more explicit way to check if file
is actually a file and not directory for example, and it is readable:
from os import access, R_OK
from os.path import isfile
file = "/some/path/to/file"
assert isfile(file) and access(file, R_OK), \
f"File {file} doesn't exist or isn't readable"