Skip to content

Conversation

@mikemhenry
Copy link
Contributor

Checklist

  • Added a news entry

Developers certificate of origin

@codecov
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.21%. Comparing base (6581c95) to head (8be0fc0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1564      +/-   ##
==========================================
- Coverage   95.25%   93.21%   -2.05%     
==========================================
  Files         172      172              
  Lines       14492    14492              
==========================================
- Hits        13805    13508     -297     
- Misses        687      984     +297     
Flag Coverage Δ
fast-tests 93.21% <100.00%> (?)
slow-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mikemhenry
Copy link
Contributor Author

@atravitz I am a bit confused by this regex, what are we to do with this test? I feel like # we *dont* want the suggestion to use --allow-partial if the user already used it! implies we are trying to make sure that if a user has --allow-partial we DON'T want it to warn us that they can use that option. But I think the regex is the same as match='[^using the\-alowpr]' (the test still passes if I use that match string) Which is like "match if there is a warning that doesn't have any of these chars"

So then when we get a warning like ResourceWarning("unclosed file <_io.TextIOWrapper name='/home/mmh/.cache/openfe/rbfe_results_serial_repeats.tar.gz.untar/rbfe_results_serial_repeats/rbfe_lig_ejm_46_solvent_lig_jmc_28_solvent/shared_RelativeHybridTopologyProtocolUnit-60df96a488094f63978880d19487d299_attempt_1/db.json' mode='r' encoding='UTF-8'>") since it has some chars that don't match, the regex matches so then the test passes.

I don't think pytest.warns works for warnings that don't come from python API and I think we are using it here to check for warnings that we expect to be printed to std out/err, so what we need to do is loop though what the command returns and check to make sure we don't see that string in the output.

At least that is what I took away from a quick look at this, I could be totally wrong!

Copy link
Contributor

@atravitz atravitz left a comment

Choose a reason for hiding this comment

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

thanks for catching this! was this causing an error, or did you find it another way?

@mikemhenry
Copy link
Contributor Author

I saw the warning about the escape syntax when I was working on an unrelated thing and you know how I like a good investigation on an esoteric code path!

This fixes the escape warning, but what are we trying to test with this test?


def test_missing_leg_allow_partial_(self, results_paths_serial_missing_legs: str):
runner = CliRunner()
# we *dont* want the suggestion to use --allow-partial if the user already used it!
Copy link
Contributor

Choose a reason for hiding this comment

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

@mikemhenry is this comment unclear? I added this test because when we ran with --allow-partial, it was still adding the you can use --allow-partial to stdout, which I think is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I missed your earlier comment before, and now I understand why this test is insufficient. Is your suggestion that we assert that you can use --allow-partial is not in stdout?

This test used to use pytest.warns to check if we printed a string to
the terminal. This isn't the right way to test if things get printed to
terminal since it only checks warnings raised in python-land. The test
passed since the regex used to match warnings ended up matching warnings
raised since it was a negated character class which matches a single
character that is not any of the characters listed inside.
@github-actions
Copy link

No API break detected ✅

@mikemhenry mikemhenry marked this pull request as ready for review October 10, 2025 18:47
@mikemhenry mikemhenry changed the title escape string correctly in test Fix test to check if we are printing --allow-partial when a user uses --allow-partial Oct 10, 2025
Copy link
Contributor

@atravitz atravitz left a comment

Choose a reason for hiding this comment

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

thank you, LGTM!

@mikemhenry mikemhenry enabled auto-merge (squash) October 10, 2025 19:30
@mikemhenry mikemhenry merged commit a312bc2 into main Oct 10, 2025
13 checks passed
@mikemhenry mikemhenry deleted the feat/fix-string-escape-warnings branch October 10, 2025 20: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.

3 participants