diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6714bd5c..82824e63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8] + python-version: ["3.10"] test_dbms: [postgresql, sqlite] services: postgres: @@ -34,8 +34,8 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip install pytest pytest-cov pip install coveralls - pip install nose pip install flake8 # - name: Lint with flake8 # run: | @@ -49,7 +49,8 @@ jobs: if: matrix.test_dbms == 'postgresql' - name: Test with nose run: | - nosetests ./tests --with-coverage --cover-package=app --cover-xml --verbose + pytest --doctest-modules --cov=app --verbose - name: Coveralls Python uses: AndreMiras/coveralls-python-action@v20201129 + if: matrix.test_dbms == 'postgresql' diff --git a/chromedriver.sh b/chromedriver.sh index 536e7b59..a0e7bf01 100755 --- a/chromedriver.sh +++ b/chromedriver.sh @@ -1,9 +1,10 @@ #!/bin/sh set -ex -wget -N https://chromedriver.storage.googleapis.com/101.0.4951.41/chromedriver_linux64.zip -P ~/ -unzip ~/chromedriver_linux64.zip -d ~/ -rm ~/chromedriver_linux64.zip -sudo mv -f ~/chromedriver /usr/local/share/ +# Use your CHROME version to find the URI https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_120.0.6099 +wget -N https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/120.0.6099.109/linux64/chromedriver-linux64.zip -P ~/ +unzip ~/chromedriver-linux64.zip -d ~/ +rm ~/chromedriver-linux64.zip +sudo mv -f ~/chromedriver-linux64/chromedriver /usr/local/share/ sudo chmod +x /usr/local/share/chromedriver sudo rm /usr/local/bin/chromedriver || echo "Nothing to remove" sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver \ No newline at end of file diff --git a/tests/fixtures.py b/conftest.py similarity index 100% rename from tests/fixtures.py rename to conftest.py diff --git a/requirements.txt b/requirements.txt index 2e7b0943..3ad644da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ # Main components -Flask==2.1.2 -Jinja2==3.1.2 -Werkzeug==2.1.2 +Flask<3.0.0 +Jinja2 +Werkzeug psycopg2-binary==2.9.3 # DB @@ -10,12 +10,12 @@ SQLAlchemy==1.4.36 sqlalchemy-utils==0.38.2 # Forms -Flask-WTF==1.0.1 +Flask-WTF==1.2.1 WTForms==3.0.1 WTForms-SQLAlchemy~=0.3 # Extensions -Flask-Login==0.6.0 +Flask-Login==0.6.3 Flask-Mail==0.9.1 email_validator<2.0.0 Flask-Compress==1.12 diff --git a/tests/test_selenium/base.py b/tests/test_selenium/base.py index f7dd85eb..58d25050 100644 --- a/tests/test_selenium/base.py +++ b/tests/test_selenium/base.py @@ -185,9 +185,7 @@ def create_driver(self, options=None): options = Options() options.add_argument("--headless") options.add_argument("--disable-gpu") - # options.add_experimental_option('w3c', False) - options.set_capability("loggingPrefs", {'browser': 'ALL'}) options.set_capability("goog:loggingPrefs", {'browser': 'ALL'}) self.driver = webdriver.Chrome(options=options) self.driver.set_window_size(1920, 1080)