Skip to content

Commit 0e9e7ad

Browse files
committed
FIcx.
1 parent 7f3fec2 commit 0e9e7ad

File tree

9 files changed

+11
-57
lines changed

9 files changed

+11
-57
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
uses: astral-sh/setup-uv@v4
2727
with:
2828
enable-cache: true
29-
- run: uv run --group typing ty check
29+
- name: Install just
30+
uses: extractions/setup-just@v2
31+
- run: just typing
3032

3133
run-tests:
3234

@@ -45,33 +47,22 @@ jobs:
4547
uses: astral-sh/setup-uv@v4
4648
with:
4749
enable-cache: true
50+
- name: Install just
51+
uses: extractions/setup-just@v2
4852
- name: Set up Python ${{ matrix.python-version }}
4953
run: uv python install ${{ matrix.python-version }}
5054

51-
# Unit, integration, and end-to-end tests.
52-
53-
- name: Run unit tests and doctests.
55+
- name: Run tests
5456
shell: bash -l {0}
55-
run: uv run --group test pytest -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
57+
run: just test
5658

57-
- name: Upload unit test coverage reports to Codecov with GitHub Action
59+
- name: Upload test coverage reports to Codecov with GitHub Action
5860
uses: codecov/codecov-action@v4
59-
with:
60-
flags: unit
61-
62-
- name: Run end-to-end tests.
63-
shell: bash -l {0}
64-
run: uv run --group test pytest -m end_to_end --cov=./ --cov-report=xml -n auto
65-
66-
- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
67-
uses: codecov/codecov-action@v4
68-
with:
69-
flags: end_to_end
7061

7162
- name: Run tests with lowest resolution
7263
if: matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'
73-
run: uv run --group test --resolution lowest-direct pytest -n auto
64+
run: just test-lowest
7465

7566
- name: Run tests with highest resolution
7667
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
77-
run: uv run --group test --resolution highest pytest -n auto
68+
run: just test-highest

justfile

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,11 @@ install:
44

55
# Run tests
66
test:
7-
uv run --group test pytest
8-
9-
# Run tests with coverage
10-
test-cov:
117
uv run --group test pytest --cov=src --cov=tests --cov-report=xml
128

13-
# Run unit tests only
14-
test-unit:
15-
uv run --group test pytest -m "unit or (not integration and not end_to_end)"
16-
17-
# Run end-to-end tests only
18-
test-e2e:
19-
uv run --group test pytest -m end_to_end
20-
219
# Run type checking
2210
typing:
23-
uv run --group typing ty check
11+
uv run --group typing --group test ty check
2412

2513
# Run linting and formatting
2614
lint:
@@ -36,7 +24,3 @@ test-lowest:
3624
# Run tests with highest dependency resolution
3725
test-highest:
3826
uv run --group test --resolution highest pytest
39-
40-
# Build package
41-
build:
42-
uv build

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,5 @@ convention = "numpy"
8484
testpaths = ["tests"]
8585
markers = [
8686
"wip: Tests that are work-in-progress.",
87-
"unit: Flag for unit tests which target mainly a single function.",
88-
"integration: Flag for integration tests which may comprise of multiple unit tests.",
89-
"end_to_end: Flag for tests that cover the whole program.",
9087
]
9188
norecursedirs = [".idea", ".tox"]

tests/test_collect.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from pytask_stata.collect import stata
1010

1111

12-
@pytest.mark.unit
1312
@pytest.mark.parametrize(
1413
("args", "kwargs", "expectation", "expected"),
1514
[
@@ -33,7 +32,6 @@ def test_stata(args, kwargs, expectation, expected):
3332
assert options == expected
3433

3534

36-
@pytest.mark.unit
3735
@pytest.mark.parametrize(
3836
("mark", "expectation", "expected"),
3937
[

tests/test_config.py

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

3-
import pytest
43
from pytask import build
54

65

7-
@pytest.mark.end_to_end
86
def test_marker_is_configured(tmp_path):
97
session = build(paths=tmp_path)
108

tests/test_execute.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from tests.conftest import needs_stata
1919

2020

21-
@pytest.mark.unit
2221
@pytest.mark.parametrize(
2322
("stata", "expectation"),
2423
[(executable, does_not_raise()) for executable in STATA_COMMANDS]
@@ -42,7 +41,6 @@ def test_pytask_execute_task_setup_raise_error(stata, platform, expectation):
4241

4342

4443
@needs_stata
45-
@pytest.mark.end_to_end
4644
def test_run_do_file(runner, tmp_path):
4745
task_source = """
4846
import pytask
@@ -72,7 +70,6 @@ def task_run_do_file():
7270

7371

7472
@needs_stata
75-
@pytest.mark.end_to_end
7673
def test_run_do_file_w_task_decorator(runner, tmp_path):
7774
task_source = """
7875
import pytask
@@ -102,7 +99,6 @@ def run_do_file():
10299
assert tmp_path.joinpath("script.log").exists()
103100

104101

105-
@pytest.mark.end_to_end
106102
def test_raise_error_if_stata_is_not_found(tmp_path, monkeypatch):
107103
task_source = """
108104
from pytask import mark, task
@@ -128,7 +124,6 @@ def task_run_do_file():
128124

129125

130126
@needs_stata
131-
@pytest.mark.end_to_end
132127
def test_run_do_file_w_wrong_cmd_option(runner, tmp_path):
133128
"""Apparently, Stata simply discards wrong cmd options."""
134129
task_source = """
@@ -154,7 +149,6 @@ def task_run_do_file():
154149

155150

156151
@needs_stata
157-
@pytest.mark.end_to_end
158152
def test_run_do_file_by_passing_path(runner, tmp_path):
159153
"""Replicates example under "Command Line Arguments" in Readme."""
160154
task_source = """
@@ -180,7 +174,6 @@ def task_run_do_file():
180174

181175

182176
@needs_stata
183-
@pytest.mark.end_to_end
184177
def test_run_do_file_fails_with_multiple_marks(runner, tmp_path):
185178
task_source = """
186179
import pytask
@@ -201,7 +194,6 @@ def task_run_do_file():
201194

202195

203196
@needs_stata
204-
@pytest.mark.end_to_end
205197
def test_with_task_without_path(runner, tmp_path):
206198
task_source = """
207199
import pytask

tests/test_normal_execution_w_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from pytask import cli
1010

1111

12-
@pytest.mark.end_to_end
1312
@pytest.mark.parametrize(
1413
"dependencies",
1514
[(), ("in.txt",), ("in_1.txt", "in_2.txt")],

tests/test_parallel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
@needs_stata
27-
@pytest.mark.end_to_end
2827
def test_parallel_parametrization_over_source_files_w_loop(runner, tmp_path):
2928
source = """
3029
import pytask
@@ -56,7 +55,6 @@ def task_execute_do_file():
5655

5756

5857
@needs_stata
59-
@pytest.mark.end_to_end
6058
def test_parallel_parametrization_over_source_file_w_loop(runner, tmp_path):
6159
source = """
6260
import pytask

tests/test_parametrize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import sys
44
import textwrap
55

6-
import pytest
76
from pytask import ExitCode
87
from pytask import cli
98

109
from tests.conftest import needs_stata
1110

1211

1312
@needs_stata
14-
@pytest.mark.end_to_end
1513
def test_parametrized_execution_of_do_file_w_loop(runner, tmp_path):
1614
source = """
1715
import pytask
@@ -41,7 +39,6 @@ def task_execute_do_file():
4139

4240

4341
@needs_stata
44-
@pytest.mark.end_to_end
4542
def test_parametrize_command_line_options_w_loop(runner, tmp_path):
4643
task_source = """
4744
import pytask

0 commit comments

Comments
 (0)