Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#26331 closed Bug (fixed)

Tests functions with typos are not detected by test runner

Reported by: George Marshall Owned by: George Marshall
Component: Testing framework Version:
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I noticed a couple of tests that either have typos or are missing the "test" keyword. This is causing them to not be detected by the test runner.

Attachments (1)

test-functions.txt (21.1 KB) - added by Moritz Sichert 6 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by George Marshall

Used the following regex to find these

^[ \t]+def (?!test).*\(self\):$

Changed 6 years ago by Moritz Sichert

Attachment: test-functions.txt added

comment:2 Changed 6 years ago by Moritz Sichert

I ran

git grep -E '^[ \t]+def .*\(self\):$' | grep -vE 'def (__|test|setUp|tearDown)'

in the tests directory to generate the attached file. For me it doesn't look like it contains any methods that should be discovered by the test runner.

comment:3 Changed 6 years ago by George Marshall

The description on the ticket is kind of ambiguous. Look at the attached pull request. This is making reference to test methods that have assertions that are not being run.

comment:4 Changed 6 years ago by Moritz Sichert

Has patch: set
Triage Stage: UnreviewedAccepted

Oh, I didn't see your pull request.
You are right, those two methods should be discovered.

comment:5 Changed 6 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 75614f6d:

Fixed #26331 -- Fixed test function names with typos

comment:6 Changed 6 years ago by Tim Graham <timograham@…>

In 4702c1a:

[1.9.x] Fixed #26331 -- Fixed test function names with typos

Backport of 75614f6d4c1a3fe779a75eb3e787452cccd1d814 from master

comment:7 Changed 6 years ago by Tim Graham <timograham@…>

In 567658f1:

[1.8.x] Fixed #26331 -- Fixed test function names with typos

Backport of 75614f6d4c1a3fe779a75eb3e787452cccd1d814 from master

Note: See TracTickets for help on using tickets.
Back to Top