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 suggestions from CodeQL scan  #317

Merged
merged 5 commits into from
Nov 21, 2023

Conversation

@giffels giffels self-assigned this Nov 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0348c67) 98.86% compared to head (880c5e0) 98.87%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #317   +/-   ##
=======================================
  Coverage   98.86%   98.87%           
=======================================
  Files          55       55           
  Lines        2210     2218    +8     
=======================================
+ Hits         2185     2193    +8     
  Misses         25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tests/utilities_t/test_asynccachemap.py Dismissed Show dismissed Hide dismissed
tests/utilities_t/test_asynccachemap.py Dismissed Show dismissed Hide dismissed
tests/utilities_t/test_asynccachemap.py Dismissed Show dismissed Hide dismissed
tests/utilities_t/test_asynccachemap.py Dismissed Show dismissed Hide dismissed
tests/utilities_t/test_asynccachemap.py Dismissed Show dismissed Hide dismissed
tests/utilities_t/test_asynccachemap.py Fixed Show fixed Hide fixed

def test_eq_async_cache_map(self):
test_static_map = StaticMapping(**self.test_data)
self.assertTrue(self.static_map == test_static_map)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertTrue(a == b) cannot provide an informative message. Using assertEqual(a, b) instead will give more informative messages.
self.assertTrue(self.static_map == test_static_map)

# Test the opposite
self.assertFalse(self.static_map != test_static_map)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertFalse(a != b) cannot provide an informative message. Using assertEqual(a, b) instead will give more informative messages.

# Change the data dictionary
test_static_map = StaticMapping(test=123)
self.assertFalse(self.static_map == test_static_map)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertFalse(a == b) cannot provide an informative message. Using assertNotEqual(a, b) instead will give more informative messages.
self.assertFalse(self.static_map == test_static_map)

# Test different class
self.assertFalse(self.static_map == self.test_data)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertFalse(a == b) cannot provide an informative message. Using assertNotEqual(a, b) instead will give more informative messages.

# Make them equal again
test_cache_map._last_update = self.async_cache_map._last_update
self.assertTrue(self.async_cache_map == test_cache_map)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertTrue(a == b) cannot provide an informative message. Using assertEqual(a, b) instead will give more informative messages.
self.assertTrue(self.async_cache_map == test_cache_map)

# Test different class
self.assertFalse(self.async_cache_map == self.test_data)

Check notice

Code scanning / CodeQL

Imprecise assert Note test

assertFalse(a == b) cannot provide an informative message. Using assertNotEqual(a, b) instead will give more informative messages.
@giffels giffels marked this pull request as ready for review November 10, 2023 15:53
@giffels giffels added the Improvement Code Improvements label Nov 10, 2023
@giffels giffels requested review from a team, eileen-kuehn and mschnepf and removed request for a team November 10, 2023 15:53
Copy link
Member

@mschnepf mschnepf 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. 👍 Thanks for your work

Copy link
Member

@maxfischer2781 maxfischer2781 left a comment

Choose a reason for hiding this comment

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

LGTM

@giffels giffels added this pull request to the merge queue Nov 21, 2023
Merged via the queue into MatterMiners:master with commit 242e4c0 Nov 21, 2023
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Code Improvements
Projects
None yet
4 participants