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

Update test_non_int.py for pytest. #1603

Merged
merged 1 commit into from
Oct 9, 2022

Conversation

cgevans
Copy link
Contributor

@cgevans cgevans commented Oct 9, 2022

Tests in test_non_int.py were not being discovered by pytest because the class names did not start with Test; they also had a few incompatibilities with pytest, which were hidden as a result of the tests not being run. This commit both enables the tests to be discovered and updates them for pytest:

  • Class names are changed.

  • Dead code (FakeWrapper) is removed.

  • Non-float assert_quantity_almost_equal is fixed.

  • Parametrization, capture_log, subTests are updated for pytest.

  • kwargs/constants are updated for pytest.

  • caplog in test_quantity_creation tests for specific message.

  • Class inheritance is changed to properly run setup_class and special assert_quantity_almost_equal.

  • Closes # (insert issue number) (N/A, but see String NaN creation with correct non_int_type #1600.

  • Executed pre-commit run --all-files with no errors

  • The change is fully covered by automated unit tests

  • Documented in docs/ as appropriate

  • Added an entry to the CHANGES file

Tests in test_non_int.py were not being discovered by pytest because
the class names did not start with Test; they also had a few
incompatibilities with pytest, which were hidden as a result of the
tests not being run.  This commit both enables the tests to be
discovered and updates them for pytest:

- Class names are changed.
- Dead code (FakeWrapper) is removed.
- Non-float assert_quantity_almost_equal is fixed.
- Parametrization, capture_log, subTests are updated for pytest.
- kwargs/constants are updated for pytest.
- caplog in test_quantity_creation tests for specific message.
- Class inheritance is changed to properly run setup_class and special
  assert_quantity_almost_equal.
@jules-ch
Copy link
Collaborator

jules-ch commented Oct 9, 2022

Thanks, it was a side effect of transitioning to pytest. Discovery of those test disappeared.
I'll do a quick review, but this looks good to me so far.

@jules-ch jules-ch merged commit f2fc479 into hgrecco:master Oct 9, 2022
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