Skip to content
Myr

Remove old helper function

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent 861aa0d · Browse files · 1 file+0 added−20 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−20 removed

  • tests:+0 added−20 removed

1 file+0 added−20 removed

modified:tests/__init__.py-20 removed
18 unmodified lines
19from contextlib import contextmanager20from flask._compat import StringIO212223def add_to_path(path):24 """Adds an entry to sys.path if it's not already there. This does25 not append it but moves it to the front so that we can be sure it26 is loaded.27 """28 if not os.path.isdir(path):29 raise RuntimeError('Tried to add nonexisting path')3031 def _samefile(x, y):32 if x == y:33 return True34 try:35 return os.path.samefile(x, y)36 except (IOError, OSError, AttributeError):37 # Windows has no samefile38 return False39 sys.path[:] = [x for x in sys.path if not _samefile(path, x)]40 sys.path.insert(0, path)414223@contextmanager24def catch_warnings():25 """Catch warnings in a with block in a list"""26 # make sure deprecation warnings are active in tests
36 unmodified lines