From 74b78c7bc04d0bad982ad1c91af1ec01b6ca91f2 Mon Sep 17 00:00:00 2001 From: Derrick Williams Date: Thu, 15 Oct 2026 16:34:08 +0000 Subject: [PATCH] fix documentation and tests for flags --- sdks/python/apache_beam/yaml/main_test.py | 7 ++++++- .../www/site/content/en/documentation/sdks/yaml-testing.md | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/yaml/main_test.py b/sdks/python/apache_beam/yaml/main_test.py index 3ef4feef11d1..84bb4e70d623 100644 --- a/sdks/python/apache_beam/yaml/main_test.py +++ b/sdks/python/apache_beam/yaml/main_test.py @@ -172,7 +172,12 @@ def test_jinja_datetime(self): fin.read().strip(), datetime.datetime.now().strftime("%Y-%m-%d")) def test_inline_test_specs(self): - main.run_tests(['--yaml_pipeline', TEST_PIPELINE, '--test'], exit=False) + for flag in ['--tests', '--test']: + known_args, pipeline_args = main._parse_arguments( + ['--yaml_pipeline', TEST_PIPELINE, flag]) + self.assertTrue(known_args.tests) + self.assertEqual(pipeline_args, []) + main.run_tests(['--yaml_pipeline', TEST_PIPELINE, flag], exit=False) def test_external_test_specs(self): with tempfile.TemporaryDirectory() as tmpdir: diff --git a/website/www/site/content/en/documentation/sdks/yaml-testing.md b/website/www/site/content/en/documentation/sdks/yaml-testing.md index 7da2942bcd6d..19bd92f0ca33 100644 --- a/website/www/site/content/en/documentation/sdks/yaml-testing.md +++ b/website/www/site/content/en/documentation/sdks/yaml-testing.md @@ -108,7 +108,7 @@ Neither the actual Read transform nor Write transform from the original pipelines are executed when running the test, but all intermediate transforms are. -This test can then be executed by running +This test can then be executed with the `--tests` (or `--test`) flag by running ``` python -m apache_beam.yaml.main \ @@ -116,7 +116,7 @@ python -m apache_beam.yaml.main \ --tests ``` -Alternatively, the a `tests:` block may be placed in a separate file and be +Alternatively, a `tests:` block may be placed in a separate file and be validated by running ``` @@ -279,7 +279,7 @@ tests: - name: Upper elements: [element: A, element: Z] - - name: TestMultipelOuptuts + - name: TestMultipleOutputs mock_inputs: - name: Upper elements: [element: m, element: nnn]