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

Remove unittest's TestCase from top level package import. #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jackton1
Copy link
Contributor

Rationale

When importing from snapshottest package this might result in confusion as the TestCase class name is used by multiple subpackages.

from snapshottest import TestCase  # This results in error for example in a django application.

Solution

Prevent wrong imports by letting the caller specify the unittest package explicitly in the import.

Rationale
=======
When importing from `snapshottest` package this might result in confusion as the `TestCase` class name is used by multiple subpackages.


Solution
======
Prevent wrong imports by using the `unittest` package.
@jackton1 jackton1 changed the title Remove unittest's TestCase Remove unittest's TestCase from top level package import. Aug 24, 2021
@ayys
Copy link
Collaborator

ayys commented Aug 1, 2024

This is good, but I only want to merge it with a major version release since this is a change in the public API.

Copy link
Collaborator

@ayys ayys left a comment

Choose a reason for hiding this comment

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

Approved but will only merge when we do a major release.

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