Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan committed Nov 16, 2018
1 parent c408e6f commit e900a88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/test_installed_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PYTHON="${2-python3}"
VENV="$(mktemp -d --tmpdir mypy-test-venv.XXXXXXXXXX)"
trap "rm -rf '$VENV'" EXIT

"$PYTHON" -m virtualenv "$VENV"
"$PYTHON" -m venv "$VENV"
source "$VENV/bin/activate"

pip install -r test-requirements.txt
Expand All @@ -26,7 +26,7 @@ cp pytest.ini conftest.py "$VENV/"
ROOT="$PWD"

# Change directory so we can't pick up any of the stuff in the root
cd /
cd "$VENV"

# Find the directory that mypy tests were installed into
MYPY_TEST_DIR="$(python3 -c 'import mypy.test; print(mypy.test.__path__[0])')"
Expand Down
2 changes: 2 additions & 0 deletions mypy/test/testcmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def normalize_file_output(content: List[str], current_abs_path: str) -> List[str
result = [x.replace(current_abs_path, '$PWD') for x in content]
version = mypy.version.__version__
result = [re.sub(r'\b' + re.escape(version) + r'\b', '$VERSION', x) for x in result]
# We generate a new mypy.version when building mypy wheels that
# lacks base_version, so handle that case.
base_version = getattr(mypy.version, 'base_version', version)
result = [re.sub(r'\b' + re.escape(base_version) + r'\b', '$VERSION', x) for x in result]
result = [timestamp_regex.sub('$TIMESTAMP', x) for x in result]
Expand Down

0 comments on commit e900a88

Please sign in to comment.