Skip to content

Commit

Permalink
Trying a different way to invoke sys.path changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Jul 2, 2020
1 parent c90741f commit 5d16f87
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions doc/workflow/examples/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ def filter(line):
return 'Running' in line or "IGNORE" in line or line.startswith('usage:') or 'Sub-commands' in line

class Test(unittest.TestCase):

def setUp(self):
self._path = os.environ['PATH']
sys.path.insert(0, sys.executable)

def tearDown(self):
os.environ['PATH'] = self._path
pass

# Find all example*.py files, and use them to define baseline tests
for file in glob.glob(datadir+'example*.py'):
Expand All @@ -42,4 +36,9 @@ def tearDown(self):

# Execute the tests
if __name__ == '__main__':
_path = os.environ['PATH']
sys.path.insert(0, sys.executable)

unittest.main()

os.environ['PATH'] = _path

0 comments on commit 5d16f87

Please sign in to comment.