Skip to content

Commit

Permalink
Merge pull request #130 from reworkd/pytest-verbosity
Browse files Browse the repository at this point in the history
Reduce default verbosity and replace bananalyzer's `-q` arg with `-v`
  • Loading branch information
KhoomeiK authored Sep 11, 2024
2 parents 6df96fa + 3b052e0 commit 9119f3d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bananalyzer/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def parse_args() -> Args:
help="A list of ids to skip tests on, separated by commas",
)
parser.add_argument(
"-q",
"--quiet",
"-v",
"--verbose",
action="store_true",
help="Will decrease the verbosity of pytest. By default we run with the `--v` pytest param.",
help="Will increase the verbosity of pytest.",
)
parser.add_argument(
"--single_browser_instance",
Expand Down Expand Up @@ -217,7 +217,7 @@ def parse_args() -> Args:
count=args.count,
pytest_args=PytestArgs(
s=args.s,
q=args.quiet,
v=args.verbose,
xml=args.junitxml,
),
xdist_args=XDistArgs(
Expand Down
2 changes: 1 addition & 1 deletion bananalyzer/data/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"badly-formatted",
"urls",
"enqueue",
"infinite-scroll"
"infinite-scroll",
]


Expand Down
2 changes: 1 addition & 1 deletion bananalyzer/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def run_tests(
args = (
test_file_names
+ ["-s"] * pytest_args.s
+ (["-q"] if pytest_args.q else ["-vvv"])
+ (["-vvv"] if pytest_args.v else ["-v"])
+ ["-n", str(xdist_args.n)]
+ ["--dist", xdist_args.dist]
+ [f"--junitxml={pytest_args.xml}"] * bool(pytest_args.xml)
Expand Down
2 changes: 1 addition & 1 deletion bananalyzer/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class PytestArgs(BaseModel):
s: bool
q: bool
v: bool
xml: Optional[str] = Field(description="Path to the xml report file")


Expand Down
2 changes: 1 addition & 1 deletion tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def pytest_args():
return PytestArgs(
s=False,
n=None,
q=False,
v=False,
xml=None,
)

Expand Down

0 comments on commit 9119f3d

Please sign in to comment.