kopia lustrzana https://github.com/halcy/Mastodon.py
move webpush and blurhash deps out of test deps
updated ci, tox, test docs accordingly updated tests to skip when deps are not presentpull/339/head
rodzic
88e838c7f0
commit
b08a15e9d9
|
@ -7,7 +7,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -20,7 +20,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -33,7 +33,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Install codecov"
|
||||
command: "pip install codecov"
|
||||
|
@ -52,7 +52,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -79,4 +79,3 @@ workflows:
|
|||
- run-tests-38-cov
|
||||
- run-tests-39
|
||||
- run-tests-310
|
||||
|
|
@ -32,22 +32,13 @@ dependencies = [
|
|||
|
||||
[project.optional-dependencies]
|
||||
webpush = [
|
||||
# when adding/updating deps, don't forget to update the test deps
|
||||
'http_ece>=1.0.5',
|
||||
'cryptography>=1.6.0',
|
||||
]
|
||||
blurhash = [
|
||||
# when adding/updating deps, don't forget to update the test deps
|
||||
'blurhash>=1.1.4',
|
||||
]
|
||||
test = [
|
||||
# webpush deps
|
||||
'http_ece>=1.0.5',
|
||||
'cryptography>=1.6.0',
|
||||
|
||||
# blurhash deps
|
||||
'blurhash>=1.1.4',
|
||||
|
||||
'pytest',
|
||||
'pytest-runner',
|
||||
'pytest-cov',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
To run this test suite, install the testing dependencies:
|
||||
|
||||
pip install -e .[test]
|
||||
pip install -e .[test,webpush,blurhash]
|
||||
|
||||
Then, run `pytest`.
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import pytest
|
||||
|
||||
import mastodon.compat
|
||||
if not mastodon.compat.IMPL_HAS_BLURHASH:
|
||||
pytest.skip("blurhash dependencies missing, skipping blurhash tests", allow_module_level=True)
|
||||
|
||||
def test_blurhash_decode(api):
|
||||
fake_media_dict = {
|
||||
'width': 320,
|
||||
|
|
|
@ -2,6 +2,10 @@ import pytest
|
|||
import time
|
||||
from mastodon.Mastodon import MastodonNotFoundError
|
||||
|
||||
import mastodon.compat
|
||||
if not mastodon.compat.IMPL_HAS_CRYPTO or not mastodon.compat.IMPL_HAS_ECE:
|
||||
pytest.skip("webpush dependencies missing, skipping webpush tests", allow_module_level=True)
|
||||
|
||||
def test_decrypt(api):
|
||||
priv = {
|
||||
'auth': b'\xe7y\x0fp\xb9\x92\xe0\xa0\xc5\xd5~Qr\xd7\xaa\x16',
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -4,5 +4,5 @@ skipsdist = true
|
|||
|
||||
|
||||
[testenv]
|
||||
deps = .[test]
|
||||
deps = .[test,webpush,blurhash]
|
||||
commands = python setup.py test
|
||||
|
|
Ładowanie…
Reference in New Issue