@@ -100,7 +100,7 @@ def test_different_python_version(self, tmp_path: Path):
100100sonar.tests=./tests
101101sonar.python.coverage.reportPaths=coverage.xml
102102sonar.verbose=false
103- sonar.exclusions=./ tests
103+ sonar.exclusions=tests/*
104104"""
105105 )
106106
@@ -129,7 +129,7 @@ def test_no_pin_python(self, tmp_path: Path):
129129sonar.tests=./tests
130130sonar.python.coverage.reportPaths=coverage.xml
131131sonar.verbose=false
132- sonar.exclusions=./ tests
132+ sonar.exclusions=tests/*
133133"""
134134 )
135135
@@ -159,7 +159,7 @@ def test_different_project_key(self, tmp_path: Path):
159159sonar.tests=./tests
160160sonar.python.coverage.reportPaths=coverage.xml
161161sonar.verbose=false
162- sonar.exclusions=./ tests
162+ sonar.exclusions=tests/*
163163"""
164164 )
165165
@@ -192,7 +192,7 @@ def test_set_verbose_true(self, tmp_path: Path):
192192sonar.tests=./tests
193193sonar.python.coverage.reportPaths=coverage.xml
194194sonar.verbose=true
195- sonar.exclusions=./ tests
195+ sonar.exclusions=tests/*
196196"""
197197 )
198198
@@ -239,7 +239,7 @@ def test_patch_version_ignored(self, tmp_path: Path):
239239sonar.tests=./tests
240240sonar.python.coverage.reportPaths=coverage.xml
241241sonar.verbose=false
242- sonar.exclusions=./ tests
242+ sonar.exclusions=tests/*
243243"""
244244 )
245245
@@ -276,7 +276,7 @@ def test_exclusions(self, tmp_path: Path):
276276sonar.tests=./tests
277277sonar.python.coverage.reportPaths=coverage.xml
278278sonar.verbose=false
279- sonar.exclusions=./ tests, **/Dockerfile, src/notebooks/**/*
279+ sonar.exclusions=tests/* , **/Dockerfile, src/notebooks/**/*
280280"""
281281 )
282282
@@ -307,7 +307,7 @@ def test_different_coverage_file_location(self, tmp_path: Path):
307307sonar.tests=./tests
308308sonar.python.coverage.reportPaths=./test-reports/cov.xml
309309sonar.verbose=false
310- sonar.exclusions=./ tests
310+ sonar.exclusions=tests/*
311311"""
312312 )
313313
@@ -325,7 +325,7 @@ def test_missing_coverage_file_location_error(self, tmp_path: Path):
325325 get_sonar_project_properties ()
326326
327327 def test_flat_layout_exclusions_already_has_tests (self , tmp_path : Path ):
328- # When using flat layout and ./ tests is already in exclusions,
328+ # When using flat layout and tests/* is already in exclusions,
329329 # it should not be added again.
330330
331331 with change_cwd (tmp_path ), PyprojectTOMLManager ():
@@ -337,7 +337,7 @@ def test_flat_layout_exclusions_already_has_tests(self, tmp_path: Path):
337337 )
338338 PyprojectTOMLManager ().set_value (
339339 keys = ["tool" , "usethis" , "sonarqube" , "exclusions" ],
340- value = ["./ tests" , "**/Dockerfile" ],
340+ value = ["tests/* " , "**/Dockerfile" ],
341341 )
342342 PyprojectTOMLManager ().set_value (
343343 keys = ["tool" , "coverage" , "xml" , "output" ], value = "coverage.xml"
@@ -357,7 +357,7 @@ def test_flat_layout_exclusions_already_has_tests(self, tmp_path: Path):
357357sonar.tests=./tests
358358sonar.python.coverage.reportPaths=coverage.xml
359359sonar.verbose=false
360- sonar.exclusions=./ tests, **/Dockerfile
360+ sonar.exclusions=tests/* , **/Dockerfile
361361"""
362362 )
363363
0 commit comments