Skip to content

Commit

Permalink
Fix TypeError when running "tox -p"
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyzk committed May 18, 2023
1 parent 357fd20 commit 8f419d4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tox_gh_actions/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,17 @@ def is_log_grouping_enabled(options: Parsed) -> bool:
# As --parallel-live option doesn't seem to be working correctly,
# this condition is more conservative compared to the plugin for tox 3.
if hasattr(options, "parallel"):
if options.parallel > 0:
# Case for `tox p` or `tox -p <num>`
return False
elif options.parallel is None:
if options.parallel is None:
# Case for `tox -p`
return False
elif isinstance(options.parallel, int) and options.parallel > 0:
# Case for `tox p` or `tox -p <num>`
return False
logger.warning(
"tox-gh-actions couldn't understand the parallel option. "
"ignoring the given option: %s",
options.parallel,
)

return True

Expand Down

0 comments on commit 8f419d4

Please sign in to comment.