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

DM-39696: Minor cleanup of test warnings #853

Merged
merged 8 commits into from
Jun 20, 2023
Merged

DM-39696: Minor cleanup of test warnings #853

merged 8 commits into from
Jun 20, 2023

Conversation

timj
Copy link
Member

@timj timj commented Jun 16, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Jun 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (a2ef0fb) 87.98% compared to head (6610155) 88.01%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #853      +/-   ##
==========================================
+ Coverage   87.98%   88.01%   +0.03%     
==========================================
  Files         269      269              
  Lines       35435    35417      -18     
  Branches     7429     7423       -6     
==========================================
- Hits        31178    31173       -5     
+ Misses       3114     3103      -11     
+ Partials     1143     1141       -2     
Impacted Files Coverage Δ
python/lsst/daf/butler/_dataset_existence.py 100.00% <ø> (ø)
python/lsst/daf/butler/registries/remote.py 80.69% <ø> (ø)
tests/test_butler.py 97.78% <100.00%> (+<0.01%) ⬆️
tests/test_cliUtils.py 97.48% <100.00%> (ø)
tests/test_simpleButler.py 98.43% <100.00%> (+5.29%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

On python 3.11 the previous code gave a warning:

tests/test_cliUtils.py::MWOptionDecoratorTest::test_option
   .../python3.11/unittest/case.py:678: DeprecationWarning: It is deprecated to return a value
           that is not None from a test case (<lsst.daf.butler.cli.utils.MWOptionDecorator object at 0x2ae76e790>)
   return self.run(*args, **kwds)
@timj
Copy link
Member Author

timj commented Jun 20, 2023

The new v1.4.0 mypy error is:

python/lsst/daf/butler/_butler.py:1657: error: Unsupported operand types for | ("Literal[DatasetExistence.RECORDED]" and "Literal[DatasetExistence._ASSUMED]")  [operator]
python/lsst/daf/butler/_butler.py:1657: error: Unsupported operand types for | ("Literal[DatasetExistence.DATASTORE]" and "Literal[DatasetExistence._ASSUMED]")  [operator]
python/lsst/daf/butler/_butler.py:1657: error: Unsupported operand types for | ("Literal[DatasetExistence._ARTIFACT]" and "Literal[DatasetExistence._ASSUMED]")  [operator]
python/lsst/daf/butler/_butler.py:1657: error: Unsupported operand types for | ("Literal[DatasetExistence.KNOWN]" and "Literal[DatasetExistence._ASSUMED]")  [operator]
python/lsst/daf/butler/_butler.py:1657: error: Unsupported operand types for | ("Literal[DatasetExistence.VERIFIED]" and "Literal[DatasetExistence._ASSUMED]")  [operator]
python/lsst/daf/butler/_butler.py:1657: note: Left operand is of type "Literal[DatasetExistence.RECORDED, DatasetExistence.DATASTORE, DatasetExistence._ARTIFACT, DatasetExistence._ASSUMED, DatasetExistence.KNOWN, DatasetExistence.VERIFIED]"

and I'm guessing that mypy is not clever to understand that different flags can be or-ed together. @andy-slac should I add an ignore annotation or does something jump out at you?

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

tests/test_simpleButler.py Show resolved Hide resolved
@timj timj merged commit c31cead into main Jun 20, 2023
@timj timj deleted the tickets/DM-39696 branch June 20, 2023 21:16
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