Don't run longrun regularily

This commit is contained in:
Matthias 2020-12-23 15:46:08 +01:00
parent 0981287c62
commit b39de171c8
3 changed files with 20 additions and 0 deletions

View File

@ -61,6 +61,12 @@ jobs:
- name: Tests
run: |
pytest --random-order --cov=freqtrade --cov-config=.coveragerc
if: matrix.python-version != '3.9'
- name: Tests incl. ccxt compatibility tests
run: |
pytest --random-order --cov=freqtrade --cov-config=.coveragerc --longrun
if: matrix.python-version == '3.9'
- name: Coveralls
if: (startsWith(matrix.os, 'ubuntu-20') && matrix.python-version == '3.8')

View File

@ -33,6 +33,19 @@ logging.getLogger('').setLevel(logging.INFO)
np.seterr(all='raise')
def pytest_addoption(parser):
parser.addoption('--longrun', action='store_true', dest="longrun",
default=False, help="Enable long-run tests (ccxt compat)")
def pytest_configure(config):
config.addinivalue_line(
"markers", "longrun: mark test that is running slowly and should not be run regularily"
)
if not config.option.longrun:
setattr(config.option, 'markexpr', 'not longrun')
def log_has(line, logs):
# caplog mocker returns log as a tuple: ('freqtrade.something', logging.WARNING, 'foobar')
# and we want to match line against foobar in the tuple

View File

@ -50,6 +50,7 @@ def exchange(request, exchange_conf):
yield exchange, request.param
@pytest.mark.longrun
class TestCCXTExchange():
def test_load_markets(self, exchange):