Skip to content

Improve test output when a test doesn't specify the correct fixture #3488

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

Merged
merged 1 commit into from
Jun 2, 2017

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jun 1, 2017

Improve things in two ways:

  1. Don't crash in tests due to missing types.ModuleType

    The fixtures used in many test cases don't import the types module
    to speed up tests, and this would often cause uncaught exceptions while
    writing tests. Now we generate a useful message instead.

  2. Suggest fixtures

    If a developer is doing certain common things in a mypy test that
    require a non-default builtins fixture (such as using typing.List), add a
    hint that points to a fixture that is likely to help.

Improve things in two ways:

1) Don't crash in tests due to missing types.ModuleType

The fixtures used in many test cases don't import the `types` module
to speed up tests, and this would often cause uncaught exceptions while
writing tests.  Now we generate a useful message instead.

2) Suggest fixtures

If a developer is doing certain common things in a mypy test that
require a non-default builtins fixture (such as `typing.List`), add a
hint that points to a fixture that is likely to help.
@gvanrossum gvanrossum merged commit 9b172e6 into master Jun 2, 2017
@gvanrossum gvanrossum deleted the test-wrong-fixture branch June 2, 2017 00:44
carljm added a commit to carljm/mypy that referenced this pull request Jun 3, 2017
* master:
  Improve test output when a test doesn't specify the correct fixture (python#3488)
  Speed up tests by simplifying the stub for typing (python#3486)
  Clean up test fixtures (python#3485)
  Add additional quick mode test cases (python#3480)
  Add --strict-optional on by default to roadmap (python#3478)
  Minor speed-up in warn-return-any (python#3481)
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.

2 participants