syrusakbary / snapshottest

Snapshot Testing utils for Python 📸
MIT License
530 stars 103 forks source link

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

Open jackton1 opened 3 years ago

jackton1 commented 3 years ago

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.

ayys commented 2 months ago

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