Skip to content

Commit bceb2c0

Browse files
muddi900terriko
andauthored
test: skip test_language_package in long tests (#4327)
* test: `test_language_package` is not skipped if LONG_TEST is disabled.[Issue #4322] * Fixed the liniting error. * changes to triage file * Updated the mark to handle all input params. --------- Co-authored-by: Terri Oda <[email protected]>
1 parent 43fc9e9 commit bceb2c0

File tree

2 files changed

+509
-31
lines changed

2 files changed

+509
-31
lines changed

test/test_language_scanner.py

Lines changed: 77 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from __future__ import annotations
55

66
from pathlib import Path
7+
from test.utils import LONG_TESTS
78

89
import pytest
910

@@ -221,66 +222,125 @@ def test_language_package_none_found(self, filename: str) -> None:
221222
@pytest.mark.parametrize(
222223
"filename,parser_class,products,namespace",
223224
[
224-
(str(TEST_FILE_PATH / "renv.lock"), parsers.r.RParser, R_PRODUCTS, "cran"),
225-
(
225+
pytest.param(
226+
str(TEST_FILE_PATH / "renv.lock"),
227+
parsers.r.RParser,
228+
R_PRODUCTS,
229+
"cran",
230+
marks=[
231+
pytest.mark.skipif(
232+
not LONG_TESTS(),
233+
reason="Test reduction in short tests",
234+
)
235+
],
236+
),
237+
pytest.param(
226238
str(TEST_FILE_PATH / "Cargo.lock"),
227239
parsers.rust.RustParser,
228240
RUST_PRODUCTS,
229241
"cargo",
242+
marks=[
243+
pytest.mark.skipif(
244+
not LONG_TESTS(),
245+
reason="Test reduction in short tests",
246+
)
247+
],
230248
),
231-
(
249+
pytest.param(
232250
str(TEST_FILE_PATH / "Gemfile.lock"),
233251
parsers.ruby.RubyParser,
234252
RUBY_PRODUCTS,
235253
"gem",
254+
marks=[
255+
pytest.mark.skipif(
256+
not LONG_TESTS(),
257+
reason="Test reduction in short tests",
258+
)
259+
],
236260
),
237-
(
261+
pytest.param(
238262
str(TEST_FILE_PATH / "requirements.txt"),
239-
parsers.python.PythonRequirementsParser,
263+
parsers.python.PythonParser,
240264
PYTHON_PRODUCTS,
241265
"pypi",
266+
marks=[
267+
pytest.mark.skipif(
268+
not LONG_TESTS(),
269+
reason="Test reduction in short tests",
270+
)
271+
],
242272
),
243-
(
273+
pytest.param(
244274
str(TEST_FILE_PATH / "package-lock.json"),
245275
parsers.javascript.JavascriptParser,
246276
JAVASCRIPT_PRODUCTS,
247277
"npm",
278+
marks=[
279+
pytest.mark.skipif(
280+
not LONG_TESTS(),
281+
reason="Test reduction in short tests",
282+
)
283+
],
248284
),
249-
(
250-
str(TEST_FILE_PATH / ".package-lock.json"),
251-
parsers.javascript.JavascriptParser,
252-
JAVASCRIPT_PRODUCTS,
253-
"npm",
254-
),
255-
(
285+
pytest.param(
256286
str(TEST_FILE_PATH / "go.mod"),
257287
parsers.go.GoParser,
258288
GO_PRODUCTS,
259289
"golang",
290+
marks=[
291+
pytest.mark.skipif(
292+
not LONG_TESTS(),
293+
reason="Test reduction in short tests",
294+
)
295+
],
260296
),
261-
(
297+
pytest.param(
262298
str(TEST_FILE_PATH / "Package.resolved"),
263299
parsers.swift.SwiftParser,
264300
SWIFT_PRODUCTS,
265301
"swift",
302+
marks=[
303+
pytest.mark.skipif(
304+
not LONG_TESTS(),
305+
reason="Test reduction in short tests",
306+
)
307+
],
266308
),
267-
(
309+
pytest.param(
268310
str(TEST_FILE_PATH / "composer.lock"),
269311
parsers.php.PhpParser,
270312
PHP_PRODUCTS,
271313
"composer",
314+
marks=[
315+
pytest.mark.skipif(
316+
not LONG_TESTS(),
317+
reason="Test reduction in short tests",
318+
)
319+
],
272320
),
273-
(
321+
pytest.param(
274322
str(TEST_FILE_PATH / "cpanfile"),
275323
parsers.perl.PerlParser,
276324
PERL_PRODUCTS,
277325
"cpan",
326+
marks=[
327+
pytest.mark.skipif(
328+
not LONG_TESTS(),
329+
reason="Test reduction in short tests",
330+
)
331+
],
278332
),
279-
(
333+
pytest.param(
280334
str(TEST_FILE_PATH / "pubspec.lock"),
281335
parsers.dart.DartParser,
282336
DART_PRODUCTS,
283337
"pub",
338+
marks=[
339+
pytest.mark.skipif(
340+
not LONG_TESTS(),
341+
reason="Test reduction in short tests",
342+
)
343+
],
284344
),
285345
],
286346
)

0 commit comments

Comments
 (0)