Skip to content

move BoxLeastSquaresResults.assert_allclose to separate testing function#7938

Merged
crawfordsm merged 1 commit intoastropy:masterfrom
eteq:bls-assert
Oct 21, 2018
Merged

move BoxLeastSquaresResults.assert_allclose to separate testing function#7938
crawfordsm merged 1 commit intoastropy:masterfrom
eteq:bls-assert

Conversation

@eteq
Copy link
Member

@eteq eteq commented Oct 21, 2018

This is an alternative to #7932 prompted by #7932 (comment) - it moves the BoxLeastSquaresResults.assert_quantity_allclose method (used for testing) into the test suite instead of in the code itself. This prevents an implicit pytest dependency that came from importing some of the testing code (which isn't supposed to be done by the user unless they have pytest)

Proximate need is to address the problem pointed out in astropy/astropy-benchmarks#68, but in general we shouldn't have a pytest import-time dependency

This prevents an implict pytest requirement at import-time
@eteq eteq added testing Affects-dev PRs and issues that do not impact an existing Astropy release labels Oct 21, 2018
@astropy-bot
Copy link

astropy-bot bot commented Oct 21, 2018

Hi there @eteq 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@crawfordsm crawfordsm merged commit 78ce128 into astropy:master Oct 21, 2018
def __dir__(self):
return list(self.keys())

def assert_allclose(self, other, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

I still think something like allclose that returns boolean might be nice for users, but I guess it can be implemented (again) if there is demand. Thanks!

@eteq eteq deleted the bls-assert branch October 22, 2018 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Affects-dev PRs and issues that do not impact an existing Astropy release stats testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants