From 116fc7114a535e6a7c117a637af0673cbf0bb6d5 Mon Sep 17 00:00:00 2001 From: george Date: Sun, 6 Feb 2022 14:37:46 +0000 Subject: [PATCH] Update test_can_be_used_as_personal_email to only skip if using GitHub Actions. --- .github/workflows/main.yml | 2 ++ tests/test_email_utils.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac667360..668d2632 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,6 +66,8 @@ jobs: - name: Test with pytest run: | pytest + env: + GITHUB_ACTIONS_TEST: true - name: Archive code coverage results uses: actions/upload-artifact@v2 diff --git a/tests/test_email_utils.py b/tests/test_email_utils.py index 642819f1..48216d5f 100644 --- a/tests/test_email_utils.py +++ b/tests/test_email_utils.py @@ -64,8 +64,9 @@ def test_email_belongs_to_alias_domains(): assert not can_create_directory_for_address("hey@d3.test") -@pytest.mark.skip( - reason="this test requires DNS lookup that does not work on Github CI" +@pytest.mark.skipif( + "GITHUB_ACTIONS_TEST" in os.environ, + reason="this test requires DNS lookup that does not work on Github CI", ) def test_can_be_used_as_personal_email(flask_client): # default alias domain