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

[WIP] Add unittest session handling, --snapshot-update support #144

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

Conversation

medmunds
Copy link
Collaborator

@medmunds medmunds commented Oct 6, 2020

Add test-session-level features for raw unittest framework:

  • Support --snapshot-update command line option
  • Issue "SnapshotTest summary" at end of test run
  • Remove unused snapshots when in update mode

This also adds snapshottest-augmented versions of the various
ways to run unittest:

  • python -m snapshottest ... parallels python -m unittest ...
    (via module-level __main__.py).
  • snapshottest.main() wraps unittest.main().
  • SnapshotTestRunnerMixin can be used with other unittest
    TestRunner classes.

Closes #51


Still need to:

  • Finalize namespaces and naming
    (is it weird that the module-level __main__.py would be
    used for unittest-specific features?)
  • Add tests
  • Track down some odd behavior where --snapshot-update
    only writes files if the snapshot data has changed, affecting
    all of nose/django/unittest, but not pytest (and apparently
    pre-dating this PR)

Add test-session-level features for raw unittest framework:
* Support --snapshot-update command line option
* Issue "SnapshotTest summary" at end of test run
* Remove unused snapshots when in update mode

This also adds snapshottest-augmented versions of the various
ways to run unittest:
* `python -m snapshottest ...` parallels `python -m unittest ...`
  (via module-level `__main__.py`).
* `snapshottest.main()` wraps `unittest.main()`.
* `SnapshotTestRunnerMixin` can be used with other unittest
  TestRunner classes.

Closes syrusakbary#51
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.

How to update snapshots with unittest?
1 participant