From 6969c5c22874b1ec72fb6f89dc04fd81d0af9aa6 Mon Sep 17 00:00:00 2001 From: Taka Date: Sat, 9 Feb 2019 17:41:15 +0000 Subject: [PATCH] Fixed some tests to skip if the Chapter H data is not provided. --- vasl_templates/webapp/tests/remote.py | 5 ++++- vasl_templates/webapp/tests/test_vasl_extensions.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/vasl_templates/webapp/tests/remote.py b/vasl_templates/webapp/tests/remote.py index 71f4f41..68cd841 100644 --- a/vasl_templates/webapp/tests/remote.py +++ b/vasl_templates/webapp/tests/remote.py @@ -241,7 +241,10 @@ class ControlTests: def _set_vo_notes_dir( self, dtype=None ): """Set the vehicle/ordnance notes directory.""" if dtype == "real": - dname = _ORIG_CHAPTER_H_NOTES_DIR + try: + dname = pytest.config.option.vo_notes #pylint: disable=no-member + except AttributeError: + dname = _ORIG_CHAPTER_H_NOTES_DIR elif dtype == "test": dname = os.path.join( os.path.split(__file__)[0], "fixtures/vo-notes" ) else: diff --git a/vasl_templates/webapp/tests/test_vasl_extensions.py b/vasl_templates/webapp/tests/test_vasl_extensions.py index d54fc29..055447f 100644 --- a/vasl_templates/webapp/tests/test_vasl_extensions.py +++ b/vasl_templates/webapp/tests/test_vasl_extensions.py @@ -94,6 +94,10 @@ def test_vasl_extension_info( webapp, webdriver ): not pytest.config.option.vasl_extensions, #pylint: disable=no-member reason = "--vasl-extensions not specified" ) +@pytest.mark.skipif( + not pytest.config.option.vo_notes, #pylint: disable=no-member + reason = "--vo-notes not specified" +) def test_dedupe_ma_notes( webapp, webdriver ): """Test deduping multi-applicable notes.""" @@ -234,6 +238,10 @@ def test_kgs_extensions( webapp, webdriver ): not pytest.config.option.vasl_extensions, #pylint: disable=no-member reason = "--vasl-extensions not specified" ) +@pytest.mark.skipif( + not pytest.config.option.vo_notes, #pylint: disable=no-member + reason = "--vo-notes not specified" +) def test_bfp_extensions( webapp, webdriver ): """Test the Bounding Fire extension.""" @@ -298,6 +306,10 @@ def test_bfp_extensions( webapp, webdriver ): not pytest.config.option.vasl_extensions, #pylint: disable=no-member reason = "--vasl-extensions not specified" ) +@pytest.mark.skipif( + not pytest.config.option.vo_notes, #pylint: disable=no-member + reason = "--vo-notes not specified" +) def test_bfp_extensions2( webapp, webdriver ): """Test the Bounding Fire extension (Operation Cobra counters)."""