Skip to content

Commit 4451bcd

Browse files
1 parent 8eed173 commit 4451bcd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

‎samples/samples/noxfile.py‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def blacken(session: nox.sessions.Session) -> None:
160160
# format = isort + black
161161
#
162162

163-
164163
@nox.session
165164
def format(session: nox.sessions.Session) -> None:
166165
"""
@@ -188,9 +187,7 @@ def _session_tests(
188187
session: nox.sessions.Session, post_install: Callable = None
189188
) -> None:
190189
# check for presence of tests
191-
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
192-
"**/test_*.py", recursive=True
193-
)
190+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
194191
test_list.extend(glob.glob("**/tests", recursive=True))
195192

196193
if len(test_list) == 0:
@@ -212,7 +209,9 @@ def _session_tests(
212209

213210
if os.path.exists("requirements-test.txt"):
214211
if os.path.exists("constraints-test.txt"):
215-
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
212+
session.install(
213+
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
214+
)
216215
else:
217216
session.install("-r", "requirements-test.txt")
218217
with open("requirements-test.txt") as rtfile:
@@ -225,9 +224,9 @@ def _session_tests(
225224
post_install(session)
226225

227226
if "pytest-parallel" in packages:
228-
concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"])
227+
concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto'])
229228
elif "pytest-xdist" in packages:
230-
concurrent_args.extend(["-n", "auto"])
229+
concurrent_args.extend(['-n', 'auto'])
231230

232231
session.run(
233232
"pytest",
@@ -257,7 +256,7 @@ def py(session: nox.sessions.Session) -> None:
257256

258257

259258
def _get_repo_root() -> Optional[str]:
260-
"""Returns the root folder of the project."""
259+
""" Returns the root folder of the project. """
261260
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
262261
p = Path(os.getcwd())
263262
for i in range(10):

0 commit comments

Comments
 (0)