From 0d714aa2633ea0983b9e3947088a0382aec20657 Mon Sep 17 00:00:00 2001 From: LxL Date: Sun, 1 Mar 2020 19:32:34 +0800 Subject: [PATCH] Test py38 instead of py36 on CircleCI (#124) * Test py38 instead of py36 on CircleCI * Update test_email_fail to ensure sending email fail --- .circleci/config.yml | 24 +++++++++++++----------- tests/test_send_text.py | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4644cc1..49fbcec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -218,14 +218,6 @@ jobs: SCRAPYDWEB_TESTMODE: True DATABASE_URL: 'mysql://root:rootpw@127.0.0.1:3306' - py36-sqlite: - <<: *test-template - docker: - - image: circleci/python:3.6 - environment: - SCRAPYDWEB_TESTMODE: True - DATA_PATH: '/home/circleci/repo/scrapydweb_data' - DATABASE_URL: 'sqlite:////home/circleci/repo/scrapydweb_database' py37-git-postgresql: <<: *test-template docker: @@ -259,6 +251,15 @@ jobs: SCRAPYDWEB_TESTMODE: True DATABASE_URL: 'mysql://root:rootpw@127.0.0.1:3306' + py38-sqlite: + <<: *test-template + docker: + - image: circleci/python:3.6 + environment: + SCRAPYDWEB_TESTMODE: True + DATA_PATH: '/home/circleci/repo/scrapydweb_data' + DATABASE_URL: 'sqlite:////home/circleci/repo/scrapydweb_database' + workflows: test: @@ -277,12 +278,13 @@ workflows: use-mysql: true - py37 - - py36-sqlite: - set-data-path: true - use-sqlite: true - py37-git-postgresql: use-git: true use-postgresql: true - py37-git-mysql: use-git: true use-mysql: true + + - py38-sqlite: + set-data-path: true + use-sqlite: true diff --git a/tests/test_send_text.py b/tests/test_send_text.py index d733eeb..73fc817 100644 --- a/tests/test_send_text.py +++ b/tests/test_send_text.py @@ -92,7 +92,7 @@ def check_pass(recipients=None, subject='Email from #scrapydweb', text=None): def test_email_fail(app, client): # EMAIL_RECIPIENTS invalid # "reason": "{'1@2': (501, b'Bad address syntax')}" - req(app, client, view='sendtextapi', kws=dict(opt='email', recipients='1@2'), + req(app, client, view='sendtextapi', kws=dict(opt='email', recipients='1@invalid_recipients'), jskws=dict(status=cst.ERROR), jskeys=['status', 'result', 'debug', 'when'], ins='email_password', nos='Sent')