Skip to content

Commit 073b74e

Browse files
committed
Fixing up some format strings in nox configs.
Using `STRING_TEMPLATE % VARIABLE` can introduce hard-to-find bugs if `VARIABLE` is expected to be a string but ends up being a tuple. Instead of using percent formatting, just using `.format`. Also making tweaks to `get_target_packages` to make some path manipulation / checks OS-independent.
1 parent e6159c6 commit 073b74e

18 files changed

Lines changed: 42 additions & 37 deletions

File tree

bigquery/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

bigtable/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def unit_tests(session, python_version):
2424
"""Run the unit test suite."""
2525

2626
# Run unit tests against all supported versions of Python.
27-
session.interpreter = 'python%s' % python_version
27+
session.interpreter = 'python{}'.format(python_version)
2828

2929
# Install all test dependencies, then install this package in-place.
3030
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -48,7 +48,7 @@ def system_tests(session, python_version):
4848
return
4949

5050
# Run the system tests against latest Python 2 and Python 3 only.
51-
session.interpreter = 'python%s' % python_version
51+
session.interpreter = 'python{}'.format(python_version)
5252

5353
# Install all test dependencies, then install this package into the
5454
# virutalenv's dist-packages.

core/nox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov',

datastore/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

dns/nox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')

error_reporting/nox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')

language/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

logging/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

monitoring/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

pubsub/nox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def unit_tests(session, python_version):
2525
"""Run the unit test suite."""
2626

2727
# Run unit tests against all supported versions of Python.
28-
session.interpreter = 'python%s' % python_version
28+
session.interpreter = 'python{}'.format(python_version)
2929

3030
# Install all test dependencies, then install this package in-place.
3131
session.install('mock', 'pytest', 'pytest-cov', '../core/')
@@ -49,7 +49,7 @@ def system_tests(session, python_version):
4949
return
5050

5151
# Run the system tests against latest Python 2 and Python 3 only.
52-
session.interpreter = 'python%s' % python_version
52+
session.interpreter = 'python{}'.format(python_version)
5353

5454
# Install all test dependencies, then install this package into the
5555
# virutalenv's dist-packages.

0 commit comments

Comments
 (0)