Repository navigation
Share the failure check in project creation tests - #173
Merged
Merged
Conversation
Most failure tests spelled out pytest.raises, the create_project call and the code assertion by hand. _fails does that and returns the error; _refused calls it and keeps its unchanged-parent check. Tests that asserted an absent target and an empty parent by hand now call _refused.
test_interrupt_after_publish_reports_that_the_target_exists repeated the fsync failure test with KeyboardInterrupt in place of OSError, minus the message checks. The fsync test now runs with both, so the interrupt case also checks the message.
Contributor
Author
Review at cd4fee2Verdict: merge-ready. The refactor is test-only and no check got weaker. CI is green at this head. How it was checked:
Landing
|
This was referenced Oct 11, 2026
Deicyde
marked this pull request as ready for review
October 11, 2026 02:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #152 and #162. Test-only:
tests/test_project_create.pygoes from 2176 to 2039 lines (+85/-222)._fails. The failure tests that callcreate_projecteach spelled outpytest.raises, the call with the default package and release, and the code check._fails(target, code, **options)does that and returns the error for message checks;_refusedcalls it and keeps its unchanged-parent check. 32 tests now call_failsand 8 more call_refused. The fivepytest.raisesblocks left call internal helpers, notcreate_project._refusedcheck more than before.test_rejects_nonsticky_shared_parentandtest_version_conflict_and_floor_messages_name_the_problemnow check that the parent is unchanged, and the second also checks its code,project-version-invalid.test_package_name_reserves_the_longest_lake_artifact_filenameandtest_macos_tmp_alias_is_rejected_but_private_tmp_is_supportedcompare the whole parent listing instead of checking one name. The other four keep equivalent checks.test_interrupt_after_publish_reports_that_the_target_existsrepeatedtest_fsync_failure_after_publish_reports_that_the_target_existswithKeyboardInterruptin place ofOSError, minus the message checks. The fsync test is now parametrized over both, so the interrupt case checks the message too.create_projectcallsfsynconce after the rename, so raising on the first call after publish, as the fsync test does, covers what the old test's raise-on-every-call did.No open PR edits this file, and the branch merges cleanly with all 12.
Validation at exact head
cd4fee28:ruff check autoform_cli servers testsis clean, andtests/test_project_create.pypasses (257).