-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2718 from bagerard/prepare_release_0_25_0
improvements for 0 25 0
- Loading branch information
Showing
5 changed files
with
42 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
) | ||
|
||
|
||
VERSION = (0, 24, 2) | ||
VERSION = (0, 25, 0) | ||
|
||
|
||
def get_version(): | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import os | ||
|
||
_THIS_MODULE = os.path.abspath(__file__) | ||
TESTS_DIR = os.path.dirname(_THIS_MODULE) | ||
|
||
ROOT_DIR = os.path.dirname(TESTS_DIR) | ||
DOCS_DIR = os.path.join(ROOT_DIR, "docs") |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
from mongoengine import get_version | ||
from tests import DOCS_DIR | ||
|
||
|
||
def test_package_version_described_in_changelog(): | ||
"""Ensures that changelog is updated when version is incremented""" | ||
version_str = get_version() | ||
changelog_content = Path(os.path.join(DOCS_DIR, "changelog.rst")).read_text() | ||
assert ( | ||
version_str in changelog_content | ||
), "Version in __init__.py not present in changelog" | ||
|
||
|
||
def test_package_version_incremented_when_new_version_added_to_changelog(): | ||
"""Ensures that changelog is updated when version is incremented""" | ||
version_str = get_version() | ||
changelog_content = Path(os.path.join(DOCS_DIR, "changelog.rst")).read_text() | ||
|
||
def find_between(s, start, end): | ||
return (s.split(start))[1].split(end)[0] | ||
|
||
most_recent_version = find_between(changelog_content, start="Changes in ", end="\n") | ||
assert most_recent_version == version_str |