Skip to content

Commit cfe90bc

Browse files
author
Jordan Macdonald
committed
Update unittests for new behaviour of CI detection
1 parent b003c44 commit cfe90bc

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

testing/test_assertion.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ def test_full_diff():
567567
result = pytester.runpytest()
568568
result.stdout.fnmatch_lines(["E Full diff:"])
569569

570+
# Setting CI to empty string is same as having it undefined
571+
monkeypatch.setenv("CI", "")
572+
result = pytester.runpytest()
573+
result.stdout.fnmatch_lines(["E Use -v to get more diff"])
574+
570575
monkeypatch.delenv("CI", raising=False)
571576
result = pytester.runpytest()
572577
result.stdout.fnmatch_lines(["E Use -v to get more diff"])
@@ -1465,6 +1470,17 @@ def test_many_lines():
14651470
result = pytester.runpytest("-vv")
14661471
result.stdout.fnmatch_lines(["* 6*"])
14671472

1473+
# Setting CI to empty string is same as having it undefined
1474+
monkeypatch.setenv("CI", "")
1475+
result = pytester.runpytest()
1476+
result.stdout.fnmatch_lines(
1477+
[
1478+
"*+ 1*",
1479+
"*+ 3*",
1480+
f"*truncated ({expected_truncated_lines} lines hidden)*use*-vv*",
1481+
]
1482+
)
1483+
14681484
monkeypatch.setenv("CI", "1")
14691485
result = pytester.runpytest()
14701486
result.stdout.fnmatch_lines(["* 6*"])

0 commit comments

Comments
 (0)