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

tests: move xfail out of functions #265

Merged
merged 6 commits into from
Oct 2, 2023

Conversation

mathause
Copy link
Contributor

I had a look at the flox tests and moved the xfails out of the function body. This is marginally faster as the skipping happens at collection time.

(It's is certainly not worth it but I couldn't sleep..., let me know if any of them look too ugly)

@pytest.fixture(scope="module", params=["flox", "numpy", "numba"])

@pytest.fixture(
scope="module", params=["flox", "numpy", pytest.param("numba", marks=requires_numba)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh nice!

def raise_if_dask_computes(max_computes=0):
# return a dummy context manager so that this can be used for non-dask objects
if not has_dask:
return dummy_context()
return nullcontext()
Copy link
Collaborator

Choose a reason for hiding this comment

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

also nice!

@dcherian
Copy link
Collaborator

dcherian commented Oct 2, 2023

This is great. Thank you!

@dcherian dcherian merged commit 528a645 into xarray-contrib:main Oct 2, 2023
dcherian added a commit that referenced this pull request Oct 2, 2023
* upstream/main:
  tests: move xfail out of functions (#265)
dcherian added a commit to mathause/flox that referenced this pull request Oct 7, 2023
* upstream/main:
  Support quantile, median, mode with method="blockwise". (xarray-contrib#269)
  Add multidimensional binning demo (xarray-contrib#203)
  [pre-commit.ci] pre-commit autoupdate (xarray-contrib#268)
  Drop python 3.8, test python 3.11 (xarray-contrib#209)
  tests: move xfail out of functions (xarray-contrib#265)
  Bump actions/checkout from 3 to 4 (xarray-contrib#267)
dcherian added a commit that referenced this pull request Nov 3, 2023
* main: (24 commits)
  Add `packaging` as dependency
  use engine flox for ordered groups (#266)
  Update pyproject.toml: py3.12
  Bump numpy to >=1.22 (#278)
  Cleanups (#276)
  benchmarks updates (#273)
  repo-review comments (#270)
  Significantly faster cohorts detection. (#272)
  Add engine="numbagg" (#72)
  Support quantile, median, mode with method="blockwise". (#269)
  Add multidimensional binning demo (#203)
  [pre-commit.ci] pre-commit autoupdate (#268)
  Drop python 3.8, test python 3.11 (#209)
  tests: move xfail out of functions (#265)
  Bump actions/checkout from 3 to 4 (#267)
  convert datetime: micro-optimizations (#261)
  compatibility with `numpy>=2.0` (#257)
  replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258)
  Fix some typing errors in asv_bench and tests (#253)
  [pre-commit.ci] pre-commit autoupdate (#250)
  ...
@mathause mathause deleted the tests_move_xfail branch January 15, 2024 13:59
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