Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_version():
# the version is taken from metadata
from aiolimiter import __version__
assert __version__
pyproject = Path(__file__).resolve().parent.parent / "pyproject.toml"
with pyproject as f:
metadata = toml.load(f)["tool"]["poetry"]
# pyproject bumps to -alpha.0, -beta.1, etc., but releases a0, b1
# We don't really need to care about those, just verify that sorta
# the right version is used.
assert __version__.startswith(metadata["version"].partition("-")[0])