Refactor test setup for temporary directories

This commit is contained in:
Oleh Prypin
2022-09-03 13:19:56 +02:00
parent 88df80e1f4
commit b53e167ad1
9 changed files with 271 additions and 338 deletions

View File

@@ -13,7 +13,8 @@ with open('README.md') as f:
def get_version(package):
"""Return package version as listed in `__version__` in `init.py`."""
init_py = open(os.path.join(package, '__init__.py')).read()
with open(os.path.join(package, '__init__.py')) as f:
init_py = f.read()
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)