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

Fix type checking tests #124

Merged
merged 4 commits into from
Jun 27, 2023
Merged

Conversation

francium
Copy link
Member

@francium francium commented Jun 26, 2023

I think mypy or pytest-mypy-plugins updated for python > 3.9, which changed union messages from Union[...] to |.

I also tried,

if sys.version_info >= (3, 10):                                                                                                                                                                                                                                              
    result_int_type = result_float_exc  # E: Incompatible types in assignment (expression has type "Ok[float] | Err[Exception]", variable has type "Ok[int] | Err[TypeError]")  [assignment]
else:                                                                                                                               
    result_int_type = result_float_exc  # E: Incompatible types in assignment (expression has type "Union[Ok[float], Err[Exception]]", variable has type "Union[Ok[int], Err[TypeError]]")  [assignment]

But that didn't seem to work locally on python 3.11

For now I'm just disabling type checking tests for <= 3.9

@codecov-commenter
Copy link

Codecov Report

Merging #124 (4594f31) into master (29af868) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   98.96%   98.96%           
=======================================
  Files           3        3           
  Lines         385      385           
=======================================
  Hits          381      381           
  Misses          4        4           
Impacted Files Coverage Δ
src/result/__init__.py 100.00% <100.00%> (ø)

@francium francium marked this pull request as ready for review June 27, 2023 00:07
@francium francium merged commit 1322699 into master Jun 27, 2023
@francium francium deleted the fix/covariance-type-checking-tests branch July 4, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants