Found an even better way of checking if running on GH actions and to skip with pytest and tidyer as well

This commit is contained in:
L1ghtn1ng 2021-08-22 03:59:34 +01:00
parent f43854ef0f
commit 59ac74e629
9 changed files with 12 additions and 56 deletions

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestAnubis:

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestBufferover(object):

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestCertspotter(object):

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestGetLinks(object):

View file

@ -1,18 +1,14 @@
#!/usr/bin/env python3
# coding=utf-8
import os
from theHarvester.lib.core import *
from theHarvester.discovery import omnisint
import os
import requests
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestOmnisint(object):
@ -20,7 +16,7 @@ class TestOmnisint(object):
def domain() -> str:
return 'uber.com'
@pytest.mark.skipif(is_github_action == 'github', reason='Skipped test as fails on CI often but not locally')
@pytest.mark.skipif(github_ci == 'True', reason='Skipping on Github CI due unstable status code from site')
async def test_api(self):
base_url = f'https://sonar.omnisint.io/all/{TestOmnisint.domain()}'
headers = {'User-Agent': Core.get_user_agent()}

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestOtx(object):

View file

@ -5,12 +5,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestSearchQwant(object):

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestSublist3r(object):

View file

@ -7,12 +7,7 @@
import pytest
pytestmark = pytest.mark.asyncio
@pytest.fixture()
def is_github_action():
if os.getenv('GITHUB_ACTIONS') is True:
return 'github'
github_ci = os.getenv('GITHUB_ACTIONS')
class TestThreatminer(object):