Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abee146

Browse files
author
Mickaël Schoentgen
committed
Get rid of @pytest.mark.integration
1 parent ff73f6f commit abee146

2 files changed

Lines changed: 0 additions & 39 deletions

File tree

tests/make_archives_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import os.path
55
import tarfile
66

7-
import pytest
8-
97
from pre_commit import git
108
from pre_commit import make_archives
119
from pre_commit.util import cmd_output
@@ -47,7 +45,6 @@ def test_make_archive(tempdir_factory):
4745
assert not os.path.exists(os.path.join(extract_dir, 'foo', 'bar'))
4846

4947

50-
@pytest.mark.integration
5148
def test_main(tmpdir):
5249
make_archives.main(('--dest', tmpdir.strpath))
5350

tests/repository_test.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def _test_hook_repo(
6363
assert _norm_out(ret[1]) == expected
6464

6565

66-
@pytest.mark.integration
6766
def test_python_hook(tempdir_factory, store):
6867
_test_hook_repo(
6968
tempdir_factory, store, 'python_hooks_repo',
@@ -72,7 +71,6 @@ def test_python_hook(tempdir_factory, store):
7271
)
7372

7473

75-
@pytest.mark.integration
7674
def test_python_hook_default_version(tempdir_factory, store):
7775
# make sure that this continues to work for platforms where default
7876
# language detection does not work
@@ -82,7 +80,6 @@ def test_python_hook_default_version(tempdir_factory, store):
8280
test_python_hook(tempdir_factory, store)
8381

8482

85-
@pytest.mark.integration
8683
def test_python_hook_args_with_spaces(tempdir_factory, store):
8784
_test_hook_repo(
8885
tempdir_factory, store, 'python_hooks_repo',
@@ -99,7 +96,6 @@ def test_python_hook_args_with_spaces(tempdir_factory, store):
9996
)
10097

10198

102-
@pytest.mark.integration
10399
def test_python_hook_weird_setup_cfg(tempdir_factory, store):
104100
path = git_dir(tempdir_factory)
105101
with cwd(path):
@@ -122,7 +118,6 @@ def test_python_venv(tempdir_factory, store): # pragma: no cover (no venv)
122118
)
123119

124120

125-
@pytest.mark.integration
126121
def test_switch_language_versions_doesnt_clobber(tempdir_factory, store):
127122
# We're using the python3 repo because it prints the python version
128123
path = make_repo(tempdir_factory, 'python3_hooks_repo')
@@ -145,7 +140,6 @@ def run_on_version(version, expected_output):
145140
run_on_version('python3', b'3\n[]\nHello World\n')
146141

147142

148-
@pytest.mark.integration
149143
def test_versioned_python_hook(tempdir_factory, store):
150144
_test_hook_repo(
151145
tempdir_factory, store, 'python3_hooks_repo',
@@ -156,7 +150,6 @@ def test_versioned_python_hook(tempdir_factory, store):
156150

157151

158152
@skipif_cant_run_docker
159-
@pytest.mark.integration
160153
def test_run_a_docker_hook(tempdir_factory, store):
161154
_test_hook_repo(
162155
tempdir_factory, store, 'docker_hooks_repo',
@@ -166,7 +159,6 @@ def test_run_a_docker_hook(tempdir_factory, store):
166159

167160

168161
@skipif_cant_run_docker
169-
@pytest.mark.integration
170162
def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
171163
_test_hook_repo(
172164
tempdir_factory, store, 'docker_hooks_repo',
@@ -176,7 +168,6 @@ def test_run_a_docker_hook_with_entry_args(tempdir_factory, store):
176168

177169

178170
@skipif_cant_run_docker
179-
@pytest.mark.integration
180171
def test_run_a_failing_docker_hook(tempdir_factory, store):
181172
_test_hook_repo(
182173
tempdir_factory, store, 'docker_hooks_repo',
@@ -187,7 +178,6 @@ def test_run_a_failing_docker_hook(tempdir_factory, store):
187178

188179

189180
@skipif_cant_run_docker
190-
@pytest.mark.integration
191181
@pytest.mark.parametrize('hook_id', ('echo-entrypoint', 'echo-cmd'))
192182
def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
193183
_test_hook_repo(
@@ -198,7 +188,6 @@ def test_run_a_docker_image_hook(tempdir_factory, store, hook_id):
198188

199189

200190
@xfailif_broken_deep_listdir
201-
@pytest.mark.integration
202191
def test_run_a_node_hook(tempdir_factory, store):
203192
_test_hook_repo(
204193
tempdir_factory, store, 'node_hooks_repo',
@@ -207,7 +196,6 @@ def test_run_a_node_hook(tempdir_factory, store):
207196

208197

209198
@xfailif_broken_deep_listdir
210-
@pytest.mark.integration
211199
def test_run_versioned_node_hook(tempdir_factory, store):
212200
_test_hook_repo(
213201
tempdir_factory, store, 'node_versioned_hooks_repo',
@@ -216,7 +204,6 @@ def test_run_versioned_node_hook(tempdir_factory, store):
216204

217205

218206
@xfailif_windows_no_ruby
219-
@pytest.mark.integration
220207
def test_run_a_ruby_hook(tempdir_factory, store):
221208
_test_hook_repo(
222209
tempdir_factory, store, 'ruby_hooks_repo',
@@ -225,7 +212,6 @@ def test_run_a_ruby_hook(tempdir_factory, store):
225212

226213

227214
@xfailif_windows_no_ruby
228-
@pytest.mark.integration
229215
def test_run_versioned_ruby_hook(tempdir_factory, store):
230216
_test_hook_repo(
231217
tempdir_factory, store, 'ruby_versioned_hooks_repo',
@@ -236,7 +222,6 @@ def test_run_versioned_ruby_hook(tempdir_factory, store):
236222

237223

238224
@xfailif_windows_no_ruby
239-
@pytest.mark.integration
240225
def test_run_ruby_hook_with_disable_shared_gems(
241226
tempdir_factory,
242227
store,
@@ -258,7 +243,6 @@ def test_run_ruby_hook_with_disable_shared_gems(
258243
)
259244

260245

261-
@pytest.mark.integration
262246
def test_system_hook_with_spaces(tempdir_factory, store):
263247
_test_hook_repo(
264248
tempdir_factory, store, 'system_hook_with_spaces_repo',
@@ -267,31 +251,27 @@ def test_system_hook_with_spaces(tempdir_factory, store):
267251

268252

269253
@skipif_cant_run_swift
270-
@pytest.mark.integration
271254
def test_swift_hook(tempdir_factory, store):
272255
_test_hook_repo(
273256
tempdir_factory, store, 'swift_hooks_repo',
274257
'swift-hooks-repo', [], b'Hello, world!\n',
275258
)
276259

277260

278-
@pytest.mark.integration
279261
def test_golang_hook(tempdir_factory, store):
280262
_test_hook_repo(
281263
tempdir_factory, store, 'golang_hooks_repo',
282264
'golang-hook', [], b'hello world\n',
283265
)
284266

285267

286-
@pytest.mark.integration
287268
def test_rust_hook(tempdir_factory, store):
288269
_test_hook_repo(
289270
tempdir_factory, store, 'rust_hooks_repo',
290271
'rust-hook', [], b'hello world\n',
291272
)
292273

293274

294-
@pytest.mark.integration
295275
@pytest.mark.parametrize('dep', ('cli:shellharden:3.1.0', 'cli:shellharden'))
296276
def test_additional_rust_cli_dependencies_installed(
297277
tempdir_factory, store, dep,
@@ -311,7 +291,6 @@ def test_additional_rust_cli_dependencies_installed(
311291
assert 'shellharden' in binaries
312292

313293

314-
@pytest.mark.integration
315294
def test_additional_rust_lib_dependencies_installed(
316295
tempdir_factory, store,
317296
):
@@ -332,7 +311,6 @@ def test_additional_rust_lib_dependencies_installed(
332311
assert 'shellharden' not in binaries
333312

334313

335-
@pytest.mark.integration
336314
def test_missing_executable(tempdir_factory, store):
337315
_test_hook_repo(
338316
tempdir_factory, store, 'not_found_exe',
@@ -342,15 +320,13 @@ def test_missing_executable(tempdir_factory, store):
342320
)
343321

344322

345-
@pytest.mark.integration
346323
def test_run_a_script_hook(tempdir_factory, store):
347324
_test_hook_repo(
348325
tempdir_factory, store, 'script_hooks_repo',
349326
'bash_hook', ['bar'], b'bar\nHello World\n',
350327
)
351328

352329

353-
@pytest.mark.integration
354330
def test_run_hook_with_spaced_args(tempdir_factory, store):
355331
_test_hook_repo(
356332
tempdir_factory, store, 'arg_per_line_hooks_repo',
@@ -360,7 +336,6 @@ def test_run_hook_with_spaced_args(tempdir_factory, store):
360336
)
361337

362338

363-
@pytest.mark.integration
364339
def test_run_hook_with_curly_braced_arguments(tempdir_factory, store):
365340
_test_hook_repo(
366341
tempdir_factory, store, 'arg_per_line_hooks_repo',
@@ -469,7 +444,6 @@ def _norm_pwd(path):
469444
)[1].strip()
470445

471446

472-
@pytest.mark.integration
473447
def test_cwd_of_hook(tempdir_factory, store):
474448
# Note: this doubles as a test for `system` hooks
475449
path = git_dir(tempdir_factory)
@@ -480,15 +454,13 @@ def test_cwd_of_hook(tempdir_factory, store):
480454
)
481455

482456

483-
@pytest.mark.integration
484457
def test_lots_of_files(tempdir_factory, store):
485458
_test_hook_repo(
486459
tempdir_factory, store, 'script_hooks_repo',
487460
'bash_hook', [os.devnull] * 15000, mock.ANY,
488461
)
489462

490463

491-
@pytest.mark.integration
492464
def test_venvs(tempdir_factory, store):
493465
path = make_repo(tempdir_factory, 'python_hooks_repo')
494466
config = make_config_from_repo(path)
@@ -497,7 +469,6 @@ def test_venvs(tempdir_factory, store):
497469
assert venv == (mock.ANY, 'python', python.get_default_version(), [])
498470

499471

500-
@pytest.mark.integration
501472
def test_additional_dependencies(tempdir_factory, store):
502473
path = make_repo(tempdir_factory, 'python_hooks_repo')
503474
config = make_config_from_repo(path)
@@ -507,7 +478,6 @@ def test_additional_dependencies(tempdir_factory, store):
507478
assert venv == (mock.ANY, 'python', python.get_default_version(), ['pep8'])
508479

509480

510-
@pytest.mark.integration
511481
def test_additional_dependencies_roll_forward(tempdir_factory, store):
512482
path = make_repo(tempdir_factory, 'python_hooks_repo')
513483

@@ -533,7 +503,6 @@ def test_additional_dependencies_roll_forward(tempdir_factory, store):
533503

534504

535505
@xfailif_windows_no_ruby
536-
@pytest.mark.integration
537506
def test_additional_ruby_dependencies_installed(
538507
tempdir_factory, store,
539508
): # pragma: no cover (non-windows)
@@ -550,7 +519,6 @@ def test_additional_ruby_dependencies_installed(
550519

551520

552521
@xfailif_broken_deep_listdir
553-
@pytest.mark.integration
554522
def test_additional_node_dependencies_installed(
555523
tempdir_factory, store,
556524
): # pragma: no cover (non-windows)
@@ -566,7 +534,6 @@ def test_additional_node_dependencies_installed(
566534
assert 'lodash' in output
567535

568536

569-
@pytest.mark.integration
570537
def test_additional_golang_dependencies_installed(
571538
tempdir_factory, store,
572539
):
@@ -695,7 +662,6 @@ def test_invalidated_virtualenv(tempdir_factory, store):
695662
assert retv == 0
696663

697664

698-
@pytest.mark.integration
699665
def test_really_long_file_paths(tempdir_factory, store):
700666
base_path = tempdir_factory.get()
701667
really_long_path = os.path.join(base_path, 'really_long' * 10)
@@ -709,7 +675,6 @@ def test_really_long_file_paths(tempdir_factory, store):
709675
repo.require_installed()
710676

711677

712-
@pytest.mark.integration
713678
def test_config_overrides_repo_specifics(tempdir_factory, store):
714679
path = make_repo(tempdir_factory, 'script_hooks_repo')
715680
config = make_config_from_repo(path)
@@ -729,7 +694,6 @@ def _create_repo_with_tags(tempdir_factory, src, tag):
729694
return path
730695

731696

732-
@pytest.mark.integration
733697
def test_tags_on_repositories(in_tmpdir, tempdir_factory, store):
734698
tag = 'v1.1'
735699
git_dir_1 = _create_repo_with_tags(tempdir_factory, 'prints_cwd_repo', tag)

0 commit comments

Comments
 (0)