Skip to content

Commit 83f89d1

Browse files
authored
Merge pull request #177 from ymyzk/fix-tox-p
Fix TypeError when running "tox -p"
2 parents 357fd20 + 8f419d4 commit 83f89d1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/tox_gh_actions/plugin.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,17 @@ def is_log_grouping_enabled(options: Parsed) -> bool:
205205
# As --parallel-live option doesn't seem to be working correctly,
206206
# this condition is more conservative compared to the plugin for tox 3.
207207
if hasattr(options, "parallel"):
208-
if options.parallel > 0:
209-
# Case for `tox p` or `tox -p <num>`
210-
return False
211-
elif options.parallel is None:
208+
if options.parallel is None:
212209
# Case for `tox -p`
213210
return False
211+
elif isinstance(options.parallel, int) and options.parallel > 0:
212+
# Case for `tox p` or `tox -p <num>`
213+
return False
214+
logger.warning(
215+
"tox-gh-actions couldn't understand the parallel option. "
216+
"ignoring the given option: %s",
217+
options.parallel,
218+
)
214219

215220
return True
216221

0 commit comments

Comments
 (0)