Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ccdc5ce

Browse filesBrowse files
committed
Proposal to fix #503 by excluding version numbers from the regression test.
1 parent b0ef645 commit ccdc5ce
Copy full SHA for ccdc5ce

File tree

Expand file treeCollapse file tree

1 file changed

+15
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-7
lines changed

‎tests/test_package_generation.py

Copy file name to clipboardExpand all lines: tests/test_package_generation.py
+15-7Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import difflib
44
import os
55
import pathlib
6+
import re
67
import shutil
78
import subprocess
89
import typing
@@ -71,14 +72,21 @@ def test_package_generation(
7172
continue
7273

7374
with actual_file.open() as f1, expected_file.open() as f2:
74-
diff += "".join(
75-
difflib.unified_diff(
76-
f1.readlines(),
77-
f2.readlines(),
78-
fromfile=str(actual_file),
79-
tofile=str(expected_file),
80-
)
75+
f1_content = f1.read()
76+
f2_content = f2.read()
77+
78+
exclude_version_numbers = r"v(\d+\.)?(\d+\.)?(\*|\d+)$"
79+
f1_content = re.sub(exclude_version_numbers, "", f1_content)
80+
f2_content = re.sub(exclude_version_numbers, "", f2_content)
81+
82+
diff += "".join(
83+
difflib.unified_diff(
84+
f1_content,
85+
f2_content,
86+
fromfile=str(actual_file),
87+
tofile=str(expected_file),
8188
)
89+
)
8290

8391
if diff:
8492
shutil.rmtree(expected_package_dir)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.