radical-cybertools / radical.utils

Utility classes and tools for various radical projects
Other
8 stars 6 forks source link

add `sh_quote()` #333

Closed andre-merzky closed 2 years ago

andre-merzky commented 2 years ago

This supports radical-cybertools/radical.pilot/pull/2522.

codecov[bot] commented 2 years ago

Codecov Report

Merging #333 (ab8b3df) into devel (88e3d85) will decrease coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #333      +/-   ##
==========================================
- Coverage   60.74%   60.67%   -0.08%     
==========================================
  Files          60       60              
  Lines        6596     6563      -33     
==========================================
- Hits         4007     3982      -25     
+ Misses       2589     2581       -8     
Impacted Files Coverage Δ
src/radical/utils/__init__.py 100.00% <100.00%> (ø)
src/radical/utils/shell.py 20.16% <100.00%> (+2.77%) :arrow_up:
src/radical/utils/zmq/utils.py 28.76% <0.00%> (-11.24%) :arrow_down:
src/radical/utils/zmq/pubsub.py 76.10% <0.00%> (-0.55%) :arrow_down:
src/radical/utils/zmq/queue.py 70.03% <0.00%> (-0.32%) :arrow_down:
src/radical/utils/misc.py 59.49% <0.00%> (-0.12%) :arrow_down:
src/radical/utils/ids.py 93.98% <0.00%> (ø)
src/radical/utils/zmq/bridge.py 63.23% <0.00%> (+0.15%) :arrow_up:
src/radical/utils/debug.py 46.15% <0.00%> (+0.16%) :arrow_up:
src/radical/utils/zmq/client.py 100.00% <0.00%> (+3.44%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 88e3d85...ab8b3df. Read the comment docs.

mtitov commented 2 years ago

All looks good, except the test setup - I would propose to have test classes based on TestCase

p.s. also would propose (and start to clean that out) not to have if __name__ == '__main__': inside tests, which breaks the purpose of using pytest (e.g., specific usage of such TestCase methods as setUp, setUpClass, etc.)

For local runs the following command could be used PYTHONPATH=src pytest tests/unittests/<test_module>, instead of python3 tests/unittests/<test_module>

andre-merzky commented 2 years ago

I changed the test structure to use the TestCase base. The rest of the discussion was moved to #334