Skip to content

Commit b9918b1

Browse files
authored
Fix testing for pytask v0.4.5. (#82)
1 parent 10856f4 commit b9918b1

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ __pycache__
1616
build
1717
dist
1818
src/pytask_parallel/_version.py
19+
tests/test_jupyter/file.txt

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ repos:
6565
attrs,
6666
cloudpickle,
6767
loky,
68-
pytask>=0.4.0,
68+
pytask>=0.4.5,
6969
rich,
7070
types-click,
7171
types-setuptools,

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and
1010
- {pull}`72` moves the project to `pyproject.toml`.
1111
- {pull}`75` updates the release strategy.
1212
- {pull}`79` add tests for Jupyter and fix parallelization with `PythonNode`s.
13+
- {pull}`82` fixes testing with pytask v0.4.5.
1314

1415
## 0.4.0 - 2023-10-07
1516

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
- toml
1313

1414
# Package dependencies
15-
- pytask>=0.4.0
15+
- pytask>=0.4.5
1616
- cloudpickle
1717
- loky
1818
- optree

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies = [
1919
"cloudpickle",
2020
"loky",
2121
"pluggy>=1.0.0",
22-
"pytask>=0.4.0",
22+
"pytask>=0.4.5",
2323
"rich"
2424
]
2525
dynamic = ["version"]
@@ -52,8 +52,8 @@ Tracker = "https://github.com/pytask-dev/pytask-parallel/issues"
5252
[tool.setuptools]
5353
include-package-data = true
5454
zip-safe = false
55-
platforms = [ "any",]
56-
license-files = [ "LICENSE",]
55+
platforms = ["any"]
56+
license-files = ["LICENSE"]
5757

5858
[tool.check-manifest]
5959
ignore = ["src/pytask_parallel/_version.py"]

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from __future__ import annotations
22

3+
import os
34
import sys
45
from contextlib import contextmanager
56
from typing import Callable
67

78
import pytest
89
from click.testing import CliRunner
10+
from nbmake.pytest_items import NotebookItem
11+
from pytask import storage
912

1013

1114
class SysPathsSnapshot:
@@ -62,10 +65,19 @@ def _restore_sys_path_and_module_after_test_execution():
6265
class CustomCliRunner(CliRunner):
6366
def invoke(self, *args, **kwargs):
6467
"""Restore sys.path and sys.modules after an invocation."""
68+
storage.create()
6569
with restore_sys_path_and_module_after_test_execution():
6670
return super().invoke(*args, **kwargs)
6771

6872

6973
@pytest.fixture()
7074
def runner():
7175
return CustomCliRunner()
76+
77+
78+
def pytest_collection_modifyitems(session, config, items) -> None: # noqa: ARG001
79+
"""Add markers to Jupyter notebook tests."""
80+
if sys.platform == "darwin" and "CI" in os.environ: # pragma: no cover
81+
for item in items:
82+
if isinstance(item, NotebookItem):
83+
item.add_marker(pytest.mark.xfail(reason="Fails regularly on MacOS"))

0 commit comments

Comments
 (0)