Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prepare for cross-framework test suite#6920

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

Kojoley
Copy link
Member

I have made a separated PR for this commit because I need a review for it (this is the base for other changes related to pytest framework support).

Changes:

  • introducedxfail(reason) function
    • uses:raise KnownFailureTest(msg) ->xfail(reason)
    • same name and signature as in pytest
  • introducedskip(reason) function
    • uses:raise SkipTest(msg) ->skip(reason)
    • same name and signature as in pytest
  • introducedskipif(condition, reason=None) decorator
    • uses: replacesdef func(): if condition: skip()
    • same name and signature as in pytest
      • can be used with functions, classes, and methods
      • supports string condition (evaluated at runtime)
  • moved nose related code totesting.nose submodule
    • plugins intesting.nose.plugins submodule
    • decorators implementation intesting.nose.decorators
      (interface is still intesting.decorators, implementation will
      have been chosen at runtime according to used test framework)
  • matplotlib.test function unifications
  • tests.py now usesmatplotlib.test()

@jenshnielsen
Copy link
Member

👍 from my first quick read of the changes

@KojoleyKojoleyforce-pushed theprepare-for-cross-framework-test-suite branch from6443d98 to634cdf3CompareAugust 8, 2016 09:19
@Kojoley
Copy link
MemberAuthor

Small fix:rcParams['backend'] ->get_backend()

try:
import nose
try:
from unittest import mock
Copy link
Member

Choose a reason for hiding this comment

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

mock is used in other tests; not sure this test should be removed.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Check is not removed, it is just moved tocheck_deps function

@KojoleyKojoleyforce-pushed theprepare-for-cross-framework-test-suite branch 2 times, most recently from7dc73af todf0d119CompareAugust 10, 2016 00:00
@story645story645 mentioned this pull requestAug 10, 2016
5 tasks
@KojoleyKojoleyforce-pushed theprepare-for-cross-framework-test-suite branch 2 times, most recently from9d7ef8d to362c271CompareAugust 10, 2016 10:25
@tacaswelltacaswell added this to the2.1 (next point release) milestoneAug 13, 2016
@tacaswell
Copy link
Member

This needs a rebase

  - introduced `xfail(reason)` function    - uses: `raise KnownFailureTest(msg)` -> `xfail(reason)`    - same name and signature as in pytest  - introduced `skip(reason)` function    - uses: `raise SkipTest(msg)` -> `skip(reason)`    - same name and signature as in pytest  - introduced `skipif(condition, reason=None)` decorator    - uses: replaces `def func(): if condition: skip()`    - same name and signature as in pytest    - can be used with functions, classes, and methods    - supports string condition (evaluated at runtime)  - moved nose related code to `testing.nose` submodule    - plugins in `testing.nose.plugins` submodule    - decorators implementation in `testing.nose.decorators`      (interface is still in `testing.decorators`, implementation will       have been chosen at runtime according to used test framework)  - `matplotlib.test` function unifications  - `tests.py` now uses `matplotlib.test()`
@KojoleyKojoleyforce-pushed theprepare-for-cross-framework-test-suite branch from362c271 tof20efb9CompareAugust 14, 2016 10:02
@Kojoley
Copy link
MemberAuthor

Ping

@@ -1,15 +1,3 @@
class KnownFailureTest(Exception):
Copy link
Member

Choose a reason for hiding this comment

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

I would rather not move this for compatibility reasons.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I am pretty sure other projects actually uses our KnownFailure stuff.

On Wed, Aug 17, 2016 at 1:15 PM, Thomas A Caswellnotifications@github.com
wrote:

In lib/matplotlib/testing/exceptions.py
#6920 (comment):

@@ -1,15 +1,3 @@
-class KnownFailureTest(Exception):

I would rather not move this for compatibility reasons.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/matplotlib/matplotlib/pull/6920/files/f20efb99d67e581f18f8fd58db07d6279528fcbd#r75165500,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-A6W8iBehFuv_ltVBw91aSSmfrI6ks5qg0GmgaJpZM4Jemgm
.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I cannot agree with this for two reasons:

  • PRs that relay onraise KnownFailureTest should not pass after this PR ever, and this change will force them to switch onxfail
  • Other projects must not relay on matplotlib testing features, it is their problem if they are

I can understand backward compatibility on matplotlib core features, but with removing nose support all this stuff will gone. I have already tried my best to make dual nose-pytest support, but leaving nose-specific stuff on the current places will blow something in any time in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Just to note, matplotlib and many other projects depend on some of numpy's
testing features. By your logic, that shouldn't be done and every project
should implement their own numerical comparison tools?

I am not exactly sure how to proceed here.

On Wed, Aug 17, 2016 at 1:31 PM, Nikita Kniazevnotifications@github.com
wrote:

In lib/matplotlib/testing/exceptions.py
#6920 (comment):

@@ -1,15 +1,3 @@
-class KnownFailureTest(Exception):

I cannot agree with this for two reasons:

  • PRs that relay on raise KnownFailureTest should not pass after this
    PR ever, and this change will force them to switch on xfail
  • Other projects must not relay on matplotlib testing features, it is
    their problem if they are

I can understand backward compatibility on matplotlib core features, but
with removing nose support all this stuff will gone. I have already tried
my best to make dual nose-pytest support, but leaving nose-specific stuff
on the current places will blow something in any time in the future.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/matplotlib/matplotlib/pull/6920/files/f20efb99d67e581f18f8fd58db07d6279528fcbd#r75168432,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARy-HYvL9iMog7FVqaAIeBGMR-v5ev-ks5qg0WIgaJpZM4Jemgm
.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

By my logic - anything that is not a part of the public API can be changed or even removed at any time, so everyone who did something like usingKnownFailureTest makes it on its own risk.

Copy link
Contributor

Choose a reason for hiding this comment

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

Numpy's tools are useful for testing using numpy arrays, so I don't find referencing them to be a compelling argument. The exceptions removed here are not unique to matplotlib functionality. It was a bad idea to for people to use them from us in the first place, and are trivially recreated for anyone down stream who happen to use them.

story645 reacted with thumbs up emoji
@tacaswell
Copy link
Member

'powercycled to try and trigger coveralls

@tacaswell
Copy link
Member

Merging this as it is blocking progress for@story645

Independent ofif the testing code should be part of the public API, people are using it that way (and to my knowledge) we have not been actively discouraging it. We are going to have to eventually shim these back or document the API changes.

@tacaswell
Copy link
Member

and the travis failure is an install failure on the basemap dependency.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v2.1
Development

Successfully merging this pull request may close these issues.

7 participants
@Kojoley@jenshnielsen@tacaswell@dopplershift@WeatherGod@QuLogic@mdboom

[8]ページ先頭

©2009-2025 Movatter.jp