Skip to content

Commit 3f28d72

Browse files
authored
Fix tests. (#15)
1 parent 14ce21b commit 3f28d72

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ all releases are available on `PyPI <https://pypi.org/project/pytask-r>`_ and
77
`Anaconda.org <https://anaconda.org/conda-forge/pytask-r>`_.
88

99

10+
0.0.10 - 2021-xx-xx
11+
-------------------
12+
13+
- :gh:`15` fixes the tests related to changes in pytask.
14+
15+
1016
0.0.9 - 2021-03-05
1117
------------------
1218

environment.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: pytask-r
2+
23
channels:
34
- conda-forge
4-
- r
5-
- pytask
5+
- nodefaults
6+
67
dependencies:
78
- python
89
- pip
@@ -25,3 +26,4 @@ dependencies:
2526
- pytest-cov
2627
- pytest-xdist
2728
- versioneer
29+
- black

tests/test_collect.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,21 @@ def test_pytask_collect_task(name, expected):
8585
],
8686
)
8787
@pytest.mark.parametrize("r_source_key", ["source", "script"])
88-
def test_pytask_collect_task_teardown(depends_on, produces, expectation, r_source_key):
88+
def test_pytask_collect_task_teardown(
89+
tmp_path, depends_on, produces, expectation, r_source_key
90+
):
8991
session = DummyClass()
9092
session.config = {"r_source_key": r_source_key}
9193

9294
task = DummyClass()
95+
task.path = tmp_path / "task_dummy.py"
96+
task.name = tmp_path.as_posix() + "task_dummy.py::task_dummy"
9397
task.depends_on = {
94-
i: FilePathNode.from_path(Path(n)) for i, n in enumerate(depends_on)
98+
i: FilePathNode.from_path(tmp_path / n) for i, n in enumerate(depends_on)
99+
}
100+
task.produces = {
101+
i: FilePathNode.from_path(tmp_path / n) for i, n in enumerate(produces)
95102
}
96-
task.produces = {i: FilePathNode.from_path(Path(n)) for i, n in enumerate(produces)}
97103
task.markers = [Mark("r", (), {})]
98104
task.function = task_dummy
99105
task.function.pytaskmark = task.markers

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ conda_deps =
1414
pytest
1515
pytest-cov
1616
pytest-xdist
17+
networkx >=2.4
1718
conda_channels =
1819
conda-forge
1920
pytask
@@ -39,6 +40,7 @@ ignore =
3940
E203 ; ignores whitespace around : which is enforced by Black.
4041
W503 ; ignores linebreak before binary operator which is enforced by Black.
4142
PT006 ; ignores that parametrizing tests with tuple argument names is preferred.
43+
PT023 ; ignores parentheses for marks.
4244
max-line-length = 88
4345
warn-symbols =
4446
pytest.mark.wip = Remove 'wip' flag for tests.

0 commit comments

Comments
 (0)