diff --git a/bookwyrm/tests/test_signing.py b/bookwyrm/tests/test_signing.py index 8653823d3..5170b4167 100644 --- a/bookwyrm/tests/test_signing.py +++ b/bookwyrm/tests/test_signing.py @@ -6,6 +6,8 @@ import pathlib import json import responses +import pytest + from django.test import TestCase, Client from django.utils.http import http_date @@ -167,6 +169,7 @@ class Signature(TestCase): response = self.send_test_request(sender=self.fake_remote) self.assertEqual(response.status_code, 401) + @pytest.mark.integration def test_changed_data(self): '''Message data must match the digest header.''' response = self.send_test_request( @@ -174,12 +177,14 @@ class Signature(TestCase): send_data=get_follow_data(self.mouse, self.cat)) self.assertEqual(response.status_code, 401) + @pytest.mark.integration def test_invalid_digest(self): response = self.send_test_request( self.mouse, digest='SHA-256=AAAAAAAAAAAAAAAAAA') self.assertEqual(response.status_code, 401) + @pytest.mark.integration def test_old_message(self): '''Old messages should be rejected to prevent replay attacks.''' response = self.send_test_request( diff --git a/fr-dev b/fr-dev index 39c8b1839..32dff5ff0 100755 --- a/fr-dev +++ b/fr-dev @@ -13,7 +13,7 @@ function rundb { } function runweb { - docker-compose run --rm web $@ + docker-compose run --rm web "$@" clean } diff --git a/pytest.ini b/pytest.ini index c6a261d6c..fa9dbc59f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,6 @@ [pytest] DJANGO_SETTINGS_MODULE = bookwyrm.settings python_files = tests.py test_*.py *_tests.py -addopts = --cov=bookwyrm --cov-config=.coveragerc \ No newline at end of file +addopts = --cov=bookwyrm --cov-config=.coveragerc +markers = + integration: marks tests as requiring external resources (deselect with '-m "not integration"')