Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Automatically discover new signals.py files in tests #181

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

timmc-edx
Copy link
Contributor

This will ensure that when new signals are added in new domains, they'll be picked up by the tests. There's still a hardcoded list, but it's just there to ensure there aren't silent regressions.

Merge checklist:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

This will ensure that when new signals are added in new domains, they'll
be picked up by the tests. There's still a hardcoded list, but it's just
there to ensure there aren't silent regressions.
@timmc-edx timmc-edx force-pushed the timmc/autodetect-signal branch from ff0286c to c7c8846 Compare February 3, 2023 18:38
Copy link
Contributor

@rgraber rgraber left a comment

Choose a reason for hiding this comment

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

LGTM

for m in pkgutil.walk_packages(root.__path__, root.__name__ + '.'):
module_name = m.name
if 'tests' in module_name.split('.') or '.test_' in module_name:
continue
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't actually care about coverage here, but it's weird that this line is allegedly not covered. There should be about 10 test modules that hit this line during the walk, and I see them locally if I put a print statement here!

Copy link
Contributor

Choose a reason for hiding this comment

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

This is because Python has optimized away that line: nedbat/coveragepy#198

@timmc-edx timmc-edx merged commit cbb59f1 into main Feb 3, 2023
@timmc-edx timmc-edx deleted the timmc/autodetect-signal branch February 3, 2023 19:27
mariajgrimaldi pushed a commit that referenced this pull request Feb 15, 2023
This will ensure that when new signals are added in new domains, they'll
be picked up by the tests. There's still a hardcoded list, but it's just
there to ensure there aren't silent regressions.
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