summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-22 10:42:50 (GMT)
committerGitHub <noreply@github.com>2025-05-22 10:42:50 (GMT)
commitdb98e0bb127c469842dc119d23e5daacd23862cc (patch)
tree5628e04625c93f2e5bde25aa29dedb3c154a0dec /Lib/test/test_venv.py
parentd5f7e80d4407655919b32bbd5746b23af174bc5b (diff)
downloadcpython-db98e0bb127c469842dc119d23e5daacd23862cc.zip
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.gz
cpython-db98e0bb127c469842dc119d23e5daacd23862cc.tar.bz2
[3.14] gh-71339: Use new assertion methods in tests (GH-129046) (GH-134498)
(cherry picked from commit 2602d8ae981c4bae1cada2c174b367d97f712efb) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index adc86a4..12c30e1 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -774,7 +774,7 @@ class BasicTest(BaseTest):
with open(script_path, 'rb') as script:
for i, line in enumerate(script, 1):
error_message = f"CR LF found in line {i}"
- self.assertFalse(line.endswith(b'\r\n'), error_message)
+ self.assertNotEndsWith(line, b'\r\n', error_message)
@requireVenvCreate
def test_scm_ignore_files_git(self):
@@ -978,7 +978,7 @@ class EnsurePipTest(BaseTest):
self.assertEqual(err, "")
out = out.decode("latin-1") # Force to text, prevent decoding errors
expected_version = "pip {}".format(ensurepip.version())
- self.assertEqual(out[:len(expected_version)], expected_version)
+ self.assertStartsWith(out, expected_version)
env_dir = os.fsencode(self.env_dir).decode("latin-1")
self.assertIn(env_dir, out)