Answer stability round 1: 1 🔴, 12 🟡 (0 misread); wait-for waits out a half-written line, prepare-scoring honours claudeMdExcludes, and a merge by another method waits for the checks
CI / tests (pull_request) Successful in 2m38s
CI / tests (pull_request) Successful in 2m38s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import contextlib
|
||||
import importlib.util
|
||||
import io
|
||||
from unittest import mock
|
||||
import os
|
||||
import pathlib
|
||||
import re
|
||||
@@ -59,6 +60,20 @@ class Report(unittest.TestCase):
|
||||
self.assertEqual(main.report("usage: pytest\nerror: unrecognized arguments\n"), [])
|
||||
|
||||
|
||||
class Main(unittest.TestCase):
|
||||
def test_prints_the_help_for_h_or_help_first_and_runs_anything_else(self):
|
||||
for argv in (["-h"], ["--help"], ["--help", "bin/x"]):
|
||||
with self.subTest(argv=argv):
|
||||
out = io.StringIO()
|
||||
with contextlib.redirect_stdout(out), mock.patch.object(main, "run") as run:
|
||||
self.assertEqual(main.main(argv), 0)
|
||||
self.assertEqual(out.getvalue(), main.__doc__.strip() + "\n")
|
||||
run.assert_not_called()
|
||||
with mock.patch.object(main, "run", return_value=1) as run:
|
||||
self.assertEqual(main.main(["bin/x", "-h"]), 1)
|
||||
run.assert_called_once_with(["bin/x", "-h"])
|
||||
|
||||
|
||||
class RunWithAStandIn(unittest.TestCase):
|
||||
"""run with a stand-in for pytest: a Python script given the arguments run passes on."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user