Skip to content

Conversation

@jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Mar 20, 2025

Description

New ruff fixes.

These are all fixing
PLC1802 [*] len(list) used as condition without comparison

Interface impacts

Testing

Unit tests

  • Linux
ska3-jeanconn-fido> git rev-parse HEAD
26855f42ea07928056720ae265be49868ef28c71
ska3-jeanconn-fido> pytest
============================= test session starts ==============================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /proj/sot/ska/jeanproj/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 113 items                                                            

mica/archive/tests/test_aca_dark_cal.py ..................               [ 15%]
mica/archive/tests/test_aca_hdr3.py ..                                   [ 17%]
mica/archive/tests/test_aca_l0.py .....                                  [ 22%]
mica/archive/tests/test_asp_l1.py .......                                [ 28%]
mica/archive/tests/test_cda.py ......................................... [ 64%]
.....                                                                    [ 69%]
mica/archive/tests/test_obspar.py .                                      [ 69%]
mica/report/tests/test_report.py ..                                      [ 71%]
mica/report/tests/test_write_report.py .                                 [ 72%]
mica/starcheck/tests/test_catalog_fetches.py ...............             [ 85%]
mica/stats/tests/test_acq_stats.py ...                                   [ 88%]
mica/stats/tests/test_guide_stats.py ....                                [ 92%]
mica/vv/tests/test_vv.py .........                                       [100%]

=============================== warnings summary ===============================
mica/mica/archive/tests/test_asp_l1.py::test_update_l1_archive
  /proj/sot/ska3/flight/lib/python3.12/pty.py:95: DeprecationWarning: This process (pid=2598697) is multi-threaded, use of forkpty() may lead to deadlocks in the child.
    pid, fd = os.forkpty()

mica/mica/archive/tests/test_cda.py::test_get_proposal_abstract
mica/mica/archive/tests/test_cda.py::test_get_proposal_abstract
mica/mica/report/tests/test_write_report.py::test_write_reports
mica/mica/report/tests/test_write_report.py::test_write_reports
  /proj/sot/ska3/flight/lib/python3.12/site-packages/bs4/builder/_lxml.py:124: DeprecationWarning: The 'strip_cdata' option of HTMLParser() has never done anything and will eventually be removed.
    parser = parser(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================= 113 passed, 5 warnings in 557.89s (0:09:17) ==================

Independent check of unit tests by [REVIEWER NAME]

  • OSX:
efbc026b53ddfc08ad52f6753e834fa1ef88e1b6
(ska3-flight) ~/SAO/git/mica more-ruff $ pytest mica                  
============================================================= test session starts =============================================================
platform darwin -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /Users/javierg/SAO/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 113 items                                                                                                                           

mica/archive/tests/test_aca_dark_cal.py ..................                                                                              [ 15%]
mica/archive/tests/test_aca_hdr3.py ..                                                                                                  [ 17%]
mica/archive/tests/test_aca_l0.py ...ss                                                                                                 [ 22%]
mica/archive/tests/test_asp_l1.py sssssss                                                                                               [ 28%]
mica/archive/tests/test_cda.py ..............................................                                                           [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                     [ 69%]
mica/report/tests/test_report.py ss                                                                                                     [ 71%]
mica/report/tests/test_write_report.py s                                                                                                [ 72%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                            [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                                  [ 88%]
mica/stats/tests/test_guide_stats.py ....                                                                                               [ 92%]
mica/vv/tests/test_vv.py sssssssss                                                                                                      [100%]

======================================================= 92 passed, 21 skipped in 24.93s =======================================================
  • Linux
jgonzale mica $ git rev-parse HEAD
efbc026b53ddfc08ad52f6753e834fa1ef88e1b6
jgonzale mica $ pytest mica
============================================================= test session starts =============================================================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
rootdir: /proj/sot/ska/jgonzalez/git
configfile: pytest.ini
plugins: anyio-4.7.0, timeout-2.3.1
collected 113 items                                                                                                                           

mica/archive/tests/test_aca_dark_cal.py ..................                                                                              [ 15%]
mica/archive/tests/test_aca_hdr3.py ..                                                                                                  [ 17%]
mica/archive/tests/test_aca_l0.py .....                                                                                                 [ 22%]
mica/archive/tests/test_asp_l1.py .......                                                                                               [ 28%]
mica/archive/tests/test_cda.py ..............................................                                                           [ 69%]
mica/archive/tests/test_obspar.py .                                                                                                     [ 69%]
mica/report/tests/test_report.py ..                                                                                                     [ 71%]
mica/report/tests/test_write_report.py .                                                                                                [ 72%]
mica/starcheck/tests/test_catalog_fetches.py ...............                                                                            [ 85%]
mica/stats/tests/test_acq_stats.py ...                                                                                                  [ 88%]
mica/stats/tests/test_guide_stats.py ....                                                                                               [ 92%]
mica/vv/tests/test_vv.py .........                                                                                                      [100%]

============================================================== warnings summary ===============================================================
mica/mica/archive/tests/test_asp_l1.py::test_update_l1_archive
  /proj/sot/ska3/flight/lib/python3.12/pty.py:95: DeprecationWarning: This process (pid=3942658) is multi-threaded, use of forkpty() may lead to deadlocks in the child.
    pid, fd = os.forkpty()

mica/mica/archive/tests/test_cda.py::test_get_proposal_abstract
mica/mica/archive/tests/test_cda.py::test_get_proposal_abstract
mica/mica/report/tests/test_write_report.py::test_write_reports
mica/mica/report/tests/test_write_report.py::test_write_reports
  /proj/sot/ska3/flight/lib/python3.12/site-packages/bs4/builder/_lxml.py:124: DeprecationWarning: The 'strip_cdata' option of HTMLParser() has never done anything and will eventually be removed.
    parser = parser(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================= 113 passed, 5 warnings in 417.05s (0:06:57) =================================================

Functional tests

No functional testing.

@jeanconn jeanconn requested a review from javierggt March 24, 2025 21:37
Copy link
Contributor

@javierggt javierggt left a comment

Choose a reason for hiding this comment

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

The changes make sense to me and I ran the tests. I do note that the sha of the commit in the test by @jeanconn does not correspond to the sha of the only commit in this PR.

@jeanconn
Copy link
Contributor Author

And yes, technically I should have rerun tests after I rebased.

@jeanconn jeanconn merged commit 4eda01c into master Apr 17, 2025
2 checks passed
@jeanconn jeanconn deleted the more-ruff branch April 17, 2025 12:24
This was referenced Jun 13, 2025
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.

3 participants