Skip to content

Instantly share code, notes, and snippets.

@wildzyzop
Created November 11, 2019 15:40
Show Gist options
  • Select an option

  • Save wildzyzop/35f9c10fbc7bc9d6bf283ef14ea6cc4f to your computer and use it in GitHub Desktop.

Select an option

Save wildzyzop/35f9c10fbc7bc9d6bf283ef14ea6cc4f to your computer and use it in GitHub Desktop.
Обход проблемы импорта из вышестоящего каталога
# -*- coding: utf-8 -*-
from __future__ import print_function
import pytest
# Обход проблемы импорта из вышестоящего каталога
# https://stackoverflow.com/a/11158224/8785369
import os, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment