Created
November 11, 2019 15:40
-
-
Save wildzyzop/35f9c10fbc7bc9d6bf283ef14ea6cc4f to your computer and use it in GitHub Desktop.
Обход проблемы импорта из вышестоящего каталога
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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