Skip to content

Commit 1bee970

Browse files
committed
Remove differentiation between test kinds.
1 parent f2bf3a6 commit 1bee970

48 files changed

Lines changed: 3 additions & 446 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,9 @@ jobs:
5151
sudo apt-get update
5252
sudo apt-get install graphviz graphviz-dev
5353
54-
# Unit, integration, and end-to-end tests.
55-
56-
- name: Run unit tests and doctests.
57-
shell: bash -l {0}
58-
run: uv run --group test pytest --nbmake -m "unit or (not integration and not end_to_end)" --cov=src --cov=tests --cov-report=xml -n auto
59-
60-
- name: Upload unit test coverage reports to Codecov with GitHub Action
61-
uses: codecov/codecov-action@v5
62-
with:
63-
flags: unit
64-
65-
- name: Run integration tests.
54+
- name: Run tests, doctests, and notebook tests
6655
shell: bash -l {0}
67-
run: uv run --group test pytest --nbmake -m integration --cov=src --cov=tests --cov-report=xml -n auto
56+
run: uv run --group test pytest --nbmake --cov=src --cov=tests --cov-report=xml -n auto
6857

69-
- name: Upload integration test coverage reports to Codecov with GitHub Action
58+
- name: Upload test coverage reports to Codecov with GitHub Action
7059
uses: codecov/codecov-action@v5
71-
with:
72-
flags: integration
73-
74-
- name: Run end-to-end tests.
75-
shell: bash -l {0}
76-
run: uv run --group test pytest --nbmake -m end_to_end --cov=src --cov=tests --cov-report=xml -n auto
77-
78-
- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
79-
uses: codecov/codecov-action@v5
80-
with:
81-
flags: end_to_end

tests/test_build.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
import textwrap
44

5-
import pytest
6-
75
from pytask import ExitCode
86
from pytask import cli
97

108

11-
@pytest.mark.end_to_end
129
def test_execution_failed(runner, tmp_path):
1310
source = """
1411
def task_raises():
@@ -20,13 +17,11 @@ def task_raises():
2017
assert result.exit_code == ExitCode.FAILED
2118

2219

23-
@pytest.mark.end_to_end
2420
def test_configuration_failed(runner, tmp_path):
2521
result = runner.invoke(cli, [tmp_path.joinpath("non_existent_path").as_posix()])
2622
assert result.exit_code == ExitCode.CONFIGURATION_FAILED
2723

2824

29-
@pytest.mark.end_to_end
3025
def test_collection_failed(runner, tmp_path):
3126
source = """
3227
raise Exception
@@ -37,7 +32,6 @@ def test_collection_failed(runner, tmp_path):
3732
assert result.exit_code == ExitCode.COLLECTION_FAILED
3833

3934

40-
@pytest.mark.end_to_end
4135
def test_building_dag_failed(runner, tmp_path):
4236
source = """
4337
from pathlib import Path

tests/test_cache.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22

33
import inspect
44

5-
import pytest
6-
75
from _pytask.cache import Cache
86
from _pytask.cache import _make_memoize_key
97

108

11-
@pytest.mark.unit
129
def test_cache():
1310
cache = Cache()
1411

@@ -32,7 +29,6 @@ def func(a, b):
3229
assert func.cache.cache_info.misses == 1
3330

3431

35-
@pytest.mark.unit
3632
def test_cache_add():
3733
cache = Cache()
3834

@@ -56,7 +52,6 @@ def func(a):
5652
assert cache.cache_info.misses == 1
5753

5854

59-
@pytest.mark.unit
6055
def test_make_memoize_key():
6156
def func(a, b): # pragma: no cover
6257
return a + b

tests/test_capture.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from collections.abc import Generator
2828

2929

30-
@pytest.mark.end_to_end
3130
@pytest.mark.parametrize("show_capture", ["s", "no", "stdout", "stderr", "all"])
3231
def test_show_capture(tmp_path, runner, show_capture):
3332
source = """
@@ -66,7 +65,6 @@ def task_show_capture():
6665
raise NotImplementedError
6766

6867

69-
@pytest.mark.end_to_end
7068
@pytest.mark.parametrize("show_capture", ["no", "stdout", "stderr", "all"])
7169
@pytest.mark.xfail(
7270
sys.platform == "win32",
@@ -114,7 +112,6 @@ def task_show_capture():
114112
raise NotImplementedError
115113

116114

117-
@pytest.mark.end_to_end
118115
@pytest.mark.xfail(
119116
sys.platform == "win32",
120117
reason="from pytask ... cannot be found",
@@ -173,7 +170,6 @@ def TeeStdCapture( # noqa: N802
173170
)
174171

175172

176-
@pytest.mark.end_to_end
177173
class TestCaptureManager:
178174
@pytest.mark.parametrize(
179175
"method", [CaptureMethod.NO, CaptureMethod.SYS, CaptureMethod.FD]
@@ -218,7 +214,6 @@ def test_init_capturing(self):
218214
capouter.stop_capturing()
219215

220216

221-
@pytest.mark.end_to_end
222217
@pytest.mark.parametrize("method", ["fd", "sys"])
223218
def test_capturing_unicode(tmp_path, runner, method):
224219
obj = "'b\u00f6y'"
@@ -239,7 +234,6 @@ def task_unicode():
239234
assert result.exit_code == ExitCode.OK
240235

241236

242-
@pytest.mark.end_to_end
243237
@pytest.mark.parametrize("method", ["fd", "sys"])
244238
@pytest.mark.skipif(sys.platform == "win32", reason="Fails on Windows.")
245239
def test_capturing_unicode_with_build(tmp_path, method):
@@ -266,7 +260,6 @@ def task_unicode():
266260
assert "1 Succeeded" in result.stdout
267261

268262

269-
@pytest.mark.end_to_end
270263
@pytest.mark.parametrize("method", ["fd", "sys"])
271264
def test_capturing_bytes_in_utf8_encoding(tmp_path, runner, method):
272265
source = """
@@ -283,7 +276,6 @@ def task_unicode():
283276
assert result.exit_code == ExitCode.OK
284277

285278

286-
@pytest.mark.end_to_end
287279
@pytest.mark.xfail(strict=True, reason="pytask cannot capture during collection.")
288280
def test_collect_capturing(tmp_path, runner):
289281
source = """
@@ -305,7 +297,6 @@ def test_collect_capturing(tmp_path, runner):
305297
assert content in result.output
306298

307299

308-
@pytest.mark.end_to_end
309300
def test_capturing_outerr(tmp_path, runner):
310301
source = """
311302
import sys
@@ -341,7 +332,6 @@ def task_capturing_error():
341332
assert content in result.output
342333

343334

344-
@pytest.mark.end_to_end
345335
def test_capture_badoutput_issue412(tmp_path, runner):
346336
source = """
347337
import os
@@ -363,7 +353,6 @@ def task_func():
363353
assert content in result.output
364354

365355

366-
@pytest.mark.unit
367356
class TestCaptureIO:
368357
def test_text(self):
369358
f = capture.CaptureIO()
@@ -389,7 +378,6 @@ def test_write_bytes_to_buffer(self):
389378
assert f.getvalue() == "foo\r\n"
390379

391380

392-
@pytest.mark.unit
393381
class TestTeeCaptureIO(TestCaptureIO):
394382
def test_text(self):
395383
sio = io.StringIO()
@@ -409,7 +397,6 @@ def test_unicode_and_str_mixture(self):
409397
pytest.raises(TypeError, f.write, b"hello")
410398

411399

412-
@pytest.mark.integration
413400
def test_dontreadfrominput():
414401
from _pytest.capture import DontReadFromInput
415402

@@ -424,7 +411,6 @@ def test_dontreadfrominput():
424411
f.close() # just for completeness
425412

426413

427-
@pytest.mark.unit
428414
def test_captureresult() -> None:
429415
cr = CaptureResult("out", "err")
430416
assert len(cr) == 2
@@ -482,7 +468,6 @@ def lsof_check():
482468
assert len2 < len1 + 3, out2
483469

484470

485-
@pytest.mark.unit
486471
class TestFDCapture:
487472
def test_simple(self, tmpfile):
488473
fd = tmpfile.fileno()
@@ -589,7 +574,6 @@ def saved_fd(fd):
589574
os.close(new_fd)
590575

591576

592-
@pytest.mark.unit
593577
class TestStdCapture:
594578
captureclass = staticmethod(StdCapture)
595579

@@ -708,7 +692,6 @@ def test_stdin_nulled_by_default(self):
708692
pytest.raises(OSError, sys.stdin.read)
709693

710694

711-
@pytest.mark.unit
712695
class TestTeeStdCapture(TestStdCapture):
713696
captureclass = staticmethod(TeeStdCapture)
714697

@@ -725,7 +708,6 @@ def test_capturing_error_recursive(self):
725708
assert out2 == "cap2\n"
726709

727710

728-
@pytest.mark.unit
729711
class TestStdCaptureFD(TestStdCapture):
730712
captureclass = staticmethod(StdCaptureFD)
731713

@@ -767,7 +749,6 @@ def test_many(self, capfd): # noqa: ARG002
767749
cap.stop_capturing()
768750

769751

770-
@pytest.mark.unit
771752
class TestStdCaptureFDinvalidFD:
772753
@pytest.mark.skipif(
773754
sys.platform == "darwin" and sys.version_info[:2] == (3, 9),
@@ -851,7 +832,6 @@ def test_fdcapture_invalid_fd_without_fd_reuse(self, tmp_path):
851832
os.write(2, b"done")
852833

853834

854-
@pytest.mark.unit
855835
def test__get_multicapture() -> None:
856836
assert isinstance(_get_multicapture(CaptureMethod.NO), MultiCapture)
857837
pytest.raises(ValueError, _get_multicapture, "unknown").match(

tests/test_clean.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def task_write_text(path=Path("in_tracked.txt"), produces=Path("out.txt")):
5656
return tmp_path
5757

5858

59-
@pytest.mark.end_to_end
6059
def test_clean_database_ignored(project, runner):
6160
with enter_directory(project):
6261
result = runner.invoke(cli, ["build"])
@@ -70,7 +69,6 @@ def test_clean_database_ignored(project, runner):
7069
assert "pytask.sqlite3" not in text_without_linebreaks
7170

7271

73-
@pytest.mark.end_to_end
7472
def test_clean_with_auto_collect(project, runner):
7573
with enter_directory(project):
7674
result = runner.invoke(cli, ["clean"])
@@ -82,7 +80,6 @@ def test_clean_with_auto_collect(project, runner):
8280
assert "to_be_deleted_file_2.txt" in text_without_linebreaks
8381

8482

85-
@pytest.mark.end_to_end
8683
@pytest.mark.parametrize("flag", ["-e", "--exclude"])
8784
@pytest.mark.parametrize("pattern", ["*_1.txt", "to_be_deleted_file_[1]*"])
8885
def test_clean_with_excluded_file(project, runner, flag, pattern):
@@ -94,7 +91,6 @@ def test_clean_with_excluded_file(project, runner, flag, pattern):
9491
assert "to_be_deleted_file_2.txt" in text_without_linebreaks
9592

9693

97-
@pytest.mark.end_to_end
9894
@pytest.mark.parametrize("flag", ["-e", "--exclude"])
9995
@pytest.mark.parametrize("pattern", ["*_1.txt", "to_be_deleted_file_[1]*"])
10096
def test_clean_with_excluded_file_via_config(project, runner, flag, pattern):
@@ -111,7 +107,6 @@ def test_clean_with_excluded_file_via_config(project, runner, flag, pattern):
111107
assert "pyproject.toml" in text_without_linebreaks
112108

113109

114-
@pytest.mark.end_to_end
115110
@pytest.mark.parametrize("flag", ["-e", "--exclude"])
116111
def test_clean_with_excluded_directory(project, runner, flag):
117112
result = runner.invoke(
@@ -123,15 +118,13 @@ def test_clean_with_excluded_directory(project, runner, flag):
123118
assert "deleted_file_1.txt" in result.output.replace("\n", "")
124119

125120

126-
@pytest.mark.end_to_end
127121
def test_clean_with_nothing_to_remove(tmp_path, runner):
128122
result = runner.invoke(cli, ["clean", "--exclude", "*", tmp_path.as_posix()])
129123

130124
assert result.exit_code == ExitCode.OK
131125
assert "There are no files and directories which can be deleted." in result.output
132126

133127

134-
@pytest.mark.end_to_end
135128
def test_clean_dry_run(project, runner):
136129
result = runner.invoke(cli, ["clean", project.as_posix()])
137130

@@ -146,7 +139,6 @@ def test_clean_dry_run(project, runner):
146139
).exists()
147140

148141

149-
@pytest.mark.end_to_end
150142
def test_clean_dry_run_w_directories(project, runner):
151143
result = runner.invoke(cli, ["clean", "-d", project.as_posix()])
152144

@@ -158,7 +150,6 @@ def test_clean_dry_run_w_directories(project, runner):
158150
assert "to_be_deleted_folder_1" in text_without_linebreaks
159151

160152

161-
@pytest.mark.end_to_end
162153
def test_clean_force(project, runner):
163154
result = runner.invoke(cli, ["clean", "--mode", "force", project.as_posix()])
164155

@@ -173,7 +164,6 @@ def test_clean_force(project, runner):
173164
).exists()
174165

175166

176-
@pytest.mark.end_to_end
177167
def test_clean_force_w_directories(project, runner):
178168
result = runner.invoke(cli, ["clean", "-d", "--mode", "force", project.as_posix()])
179169

@@ -185,7 +175,6 @@ def test_clean_force_w_directories(project, runner):
185175
assert "to_be_deleted_folder_1" in text_without_linebreaks
186176

187177

188-
@pytest.mark.end_to_end
189178
def test_clean_interactive(project, runner):
190179
result = runner.invoke(
191180
cli,
@@ -204,7 +193,6 @@ def test_clean_interactive(project, runner):
204193
).exists()
205194

206195

207-
@pytest.mark.end_to_end
208196
def test_clean_interactive_w_directories(project, runner):
209197
result = runner.invoke(
210198
cli,
@@ -222,15 +210,13 @@ def test_clean_interactive_w_directories(project, runner):
222210
assert not project.joinpath("to_be_deleted_folder_1").exists()
223211

224212

225-
@pytest.mark.end_to_end
226213
def test_configuration_failed(runner, tmp_path):
227214
result = runner.invoke(
228215
cli, ["clean", tmp_path.joinpath("non_existent_path").as_posix()]
229216
)
230217
assert result.exit_code == ExitCode.CONFIGURATION_FAILED
231218

232219

233-
@pytest.mark.end_to_end
234220
def test_collection_failed(runner, tmp_path):
235221
source = """
236222
raise Exception
@@ -241,7 +227,6 @@ def test_collection_failed(runner, tmp_path):
241227
assert result.exit_code == ExitCode.COLLECTION_FAILED
242228

243229

244-
@pytest.mark.end_to_end
245230
def test_dont_remove_files_tracked_by_git(runner, git_project):
246231
result = runner.invoke(cli, ["clean", git_project.as_posix()])
247232

@@ -251,7 +236,6 @@ def test_dont_remove_files_tracked_by_git(runner, git_project):
251236
assert ".git" not in result.output
252237

253238

254-
@pytest.mark.end_to_end
255239
def test_clean_git_files_if_git_is_not_installed(monkeypatch, runner, git_project):
256240
monkeypatch.setattr(
257241
"_pytask.clean.is_git_installed",
@@ -266,7 +250,6 @@ def test_clean_git_files_if_git_is_not_installed(monkeypatch, runner, git_projec
266250
assert ".git" not in result.output
267251

268252

269-
@pytest.mark.end_to_end
270253
def test_clean_git_files_if_git_is_installed_but_git_root_is_not_found(
271254
monkeypatch, runner, git_project
272255
):

0 commit comments

Comments
 (0)