Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New from_environment_as_dataclass() Test #41

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ project_urls =
version_variable = wipac_dev_tools/__init__.py:__version__
upload_to_pypi = True
patch_without_tag = True
commit_parser = semantic_release.history.tag_parser
minor_tag = [minor]
fix_tag = [fix]
commit_parser = semantic_release.history.emoji_parser
major_emoji = [major]
minor_emoji = [minor]
patch_emoji = [fix], [patch]
branch = main

[options] # generated by wipac:cicd_setup_builder: python_requires, packages
Expand Down
22 changes: 10 additions & 12 deletions tests/enviro_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,18 +626,16 @@ class Config:
with self.assertRaises(TypeError):
from_environment_as_dataclass(Config)

# NOTE: mypy crashes with an un-typed non-initialized 'Final'
# see https://github.com/python/mypy/issues/10090
# def test_109_error__final_only(self) -> None:
# """Test error use case."""

# @dc.dataclass(frozen=True)
# class Config:
# FOO: Final # type: ignore[misc] # ...this is an error after all

# os.environ["FOO"] = "foo bar baz"
# with self.assertRaises(ValueError):
# from_environment_as_dataclass(Config)
def test_109_error__final_only(self) -> None:
"""Test error use case."""

@dc.dataclass(frozen=True)
class Config:
FOO: Final

os.environ["FOO"] = "foo bar baz"
with self.assertRaises(ValueError):
from_environment_as_dataclass(Config)

def test_110_error__any(self) -> None:
"""Test error use case."""
Expand Down