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

Pytest Plugin #41

Merged
merged 2 commits into from
Oct 12, 2020
Merged

Pytest Plugin #41

merged 2 commits into from
Oct 12, 2020

Conversation

bbonenfant
Copy link
Contributor

@bbonenfant bbonenfant commented Oct 4, 2020

This PR sets up the repository to be used as a pytest plugin. This includes the following:

  • All of the functionality in snappiershot/plugins/pytest.py.
  • Setting the pytest11 plugin within the pyproject.toml file.
  • Use of the pytester plugin and tester fixture to test the plugin. More information can be found here

In addition, the following objects and functionality was added:

  • Created the snappiershot.plugins.tracker.Tracker object
    for tracking the status of snapshots throughout an entire run.
  • Created the snappiershot.snapshot.SnapshotStatus enum.
  • Updated the config object, removing the "significant figures"
    configuration and adding a "full diff" configuration.

Finally, the following infrastructure change occurred:

  • Removed the pytest-cov dependency. Unfortunately if does not work
    well with testing coverage of pytest coverage. More information can
    be found here
  • Created the run_tests.sh bash script for running tests.

Closes #26

* Set up the project to be used as a pytest plugin.
* Created the `snappiershot.plugins.tracker.Tracker` object
for tracking the status of snapshots throughout an entire run.

Other Notes:
* Updated the config object, removing the "significant figures"
configuration and adding a "full diff" configuration.
* Removed the pytest-cov dependency. Unfortunately if does not work
well with testing coverage of pytest coverage. More information can
be found here:
https://pytest-cov.readthedocs.io/en/latest/plugins.html
* Created the run_tests.sh bash script for running tests.
@bbonenfant bbonenfant added enhancement New feature or request Infrastructure Improve the repository infrastructure labels Oct 4, 2020
@bbonenfant bbonenfant requested a review from lenabradley October 4, 2020 22:14
float_absolute_tolerance = 1e-6
float_relative_tolerance = 0.001
full_diff = false
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps a more clear variable name show_full_diff? also its a bit unclear what a non-full diff implies... Should be more clear/verbose about this throughout

Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps out of scope, but may want to consider for later: do we want levels of verbosity? (rather than binary)

@@ -0,0 +1,69 @@
""" Tests for snappiershot/plugins/pytest.py """
Copy link
Contributor

Choose a reason for hiding this comment

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

ah yes the wonderful meta testing :)

@lenabradley
Copy link
Contributor

Update the README to include a pytest usage example

@bbonenfant bbonenfant merged commit 96f89e2 into primary Oct 12, 2020
@bbonenfant bbonenfant deleted the pytest branch October 12, 2020 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Infrastructure Improve the repository infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pytest plugin support
2 participants