Skip to content

Collect the two invalid-unit tests - #1085

Open
dylanpulver wants to merge 1 commit into
python-pendulum:masterfrom
dylanpulver:tests/collect-invalid-unit-tests
Open

dylanpulver wants to merge 1 commit into
python-pendulum:masterfrom
dylanpulver:tests/collect-invalid-unit-tests

Conversation

@dylanpulver

Copy link
Copy Markdown
Contributor

start_of_with_invalid_unit and end_of_with_invalid_unit sit between 48 collected tests in tests/datetime/test_start_end_of.py, each with a pytest.raises(ValueError) body, but neither name starts with test_, so pytest never collects them and nothing else in the tree calls them.

def start_of_with_invalid_unit():
    with pytest.raises(ValueError):
        pendulum.now().start_of("invalid")


def end_of_with_invalid_unit():
    with pytest.raises(ValueError):
        pendulum.now().end_of("invalid")

Verification

tests/datetime/test_start_end_of.py goes from 48 to 50 passed.

Both newly collected tests pass, and they are not passing vacuously: replacing "invalid" with a real unit makes the renamed test fail, which confirms the pytest.raises block is doing the work.

tests/datetime/: 573 passed.

start_of_with_invalid_unit and end_of_with_invalid_unit sit between 48
collected tests in the same file, each with a pytest.raises(ValueError) body,
but neither name starts with test_ so pytest never collects them and nothing
else calls them.

tests/datetime/test_start_end_of.py goes from 48 to 50 passed. Replacing
"invalid" with a real unit fails the renamed test, which confirms the
pytest.raises block is now doing the work.

tests/datetime: 573 passed.
@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 note

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: the symbols of the profiling trace could not be resolved, because no information about the language frames was collected.

See affected benchmarks

✅ 1 untouched benchmark


Comparing dylanpulver:tests/collect-invalid-unit-tests (5311311) with master (e06dace)

Open in CodSpeed

This branch has not been deployed

No deployments
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.

1 participant