diff options
author | Karl Lorey <git@karllorey.com> | 2022-08-18 17:38:56 +0200 |
---|---|---|
committer | Karl Lorey <git@karllorey.com> | 2022-08-18 17:39:36 +0200 |
commit | 1887459468e37942218d4be3ac1187709cb883ab (patch) | |
tree | 60205ca2684b3b54ca0f785fe74861b7b717c907 /tests | |
parent | c0b805843d5ca05ef579a3fbd4f2e5a524688a27 (diff) |
Fix testing examples by only running them in specialized environment
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_examples.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_examples.py b/tests/test_examples.py index ea385aa..a510ada 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,10 +1,16 @@ -from examples.quotes_to_scrape import main as quotes_to_scrape_main +import os +import pytest +PYTEST_SKIP_EXAMPLES = os.environ.get("PYTEST_SKIP_EXAMPLES", "1") + + +@pytest.mark.skipif(PYTEST_SKIP_EXAMPLES == "1", reason=f'"{PYTEST_SKIP_EXAMPLES=}"') def test_example_quotes_to_scrape(): """ Test if the example quotes_to_scrape.py works """ + from examples.quotes_to_scrape import main as quotes_to_scrape_main assert quotes_to_scrape_main() == { "name": "J.K. Rowling", |