-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* removing exclusion for `__init__.py` * removing __version__.py blanket exclusion * adding test for copyright in `__init__.py`
- Loading branch information
1 parent
59dc96f
commit c75cee2
Showing
5 changed files
with
38 additions
and
30 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
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 |
---|---|---|
@@ -1,27 +1,9 @@ | ||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
from screenpy import __version__ | ||
|
||
|
||
def test_metadata() -> None: | ||
assert __version__.__title__ == "screenpy" | ||
assert __version__.__license__ == "MIT" | ||
assert __version__.__author__ == "Perry Goy" | ||
|
||
|
||
def test_copyright_year() -> None: | ||
current = datetime.now().year | ||
|
||
assert f"{current}" in __version__.__copyright__ | ||
|
||
|
||
def test_copyright_year_in_license() -> None: | ||
current = datetime.now().year | ||
license_path = Path(__file__).parent / ".." / "LICENSE" | ||
with open(license_path) as fp: | ||
license_text = fp.read() | ||
|
||
assert f"{current}" in license_text |
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,27 @@ | ||
from __future__ import annotations | ||
|
||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from screenpy import __doc__, __version__ | ||
|
||
|
||
class TestCopyrightYear: | ||
@pytest.fixture(autouse=True) | ||
def _setup(self) -> None: | ||
self.current_year = datetime.now().year | ||
|
||
def test_version(self) -> None: | ||
assert f"{self.current_year}" in __version__.__copyright__ | ||
|
||
def test_license(self) -> None: | ||
license_path = Path(__file__).parent / ".." / "LICENSE" | ||
with open(license_path) as fp: | ||
license_text = fp.read() | ||
|
||
assert f"{self.current_year}" in license_text | ||
|
||
def test_init(self) -> None: | ||
assert f"{self.current_year}" in __doc__ |