Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @pytest.mark.fuzz and @pytest.mark.functional #5620

Merged
merged 3 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/functional/api/groups/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
native_str = str


@pytest.mark.functional
class TestCreateGroup(object):
def test_it_returns_http_200_with_valid_payload(self, app, token_auth_header):
group = {"name": "My Group"}
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/api/groups/test_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
native_str = str


@pytest.mark.functional
class TestAddMember(object):
def test_it_returns_http_204_when_successful(
self, app, third_party_user, third_party_group, auth_client_header
Expand Down Expand Up @@ -146,7 +145,6 @@ def test_it_returns_404_with_token_auth(self, app, token_auth_header, user, grou
assert res.status_code == 404


@pytest.mark.functional
class TestRemoveMember(object):
def test_it_removes_authed_user_from_group(
self, app, group, group_member_with_token
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/api/groups/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
native_str = str


@pytest.mark.functional
class TestReadGroups(object):
# TODO: In subsequent versions of the API, this should really be a group
# search endpoint and should have its own functional test module
Expand Down Expand Up @@ -59,7 +58,6 @@ def test_it_expands_scope_if_requested(self, app):
assert "scopes" in res.json[0]


@pytest.mark.functional
class TestReadGroup(object):
def test_it_returns_http_200_for_world_readable_group_pubid(
self, app, factories, db_session
Expand Down
1 change: 0 additions & 1 deletion tests/functional/api/groups/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
native_str = str


@pytest.mark.functional
class TestUpdateGroup(object):
def test_it_returns_http_200_with_valid_payload_and_user_token(
self, app, token_auth_header, first_party_group
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/api/groups/test_upsert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
native_str = str


@pytest.mark.functional
class TestUpsertGroupUpdate(object):
def test_it_returns_http_404_if_no_authenticated_user(self, app, first_party_group):
group = {"name": "My Group"}
Expand Down Expand Up @@ -210,7 +209,6 @@ def test_it_returns_HTTP_Conflict_if_groupid_is_duplicate(
assert res.status_code == 409


@pytest.mark.functional
class TestUpsertGroupCreate(object):
def test_it_allows_auth_client_with_forwarded_user(
self, app, auth_client_header, third_party_user
Expand Down
4 changes: 0 additions & 4 deletions tests/functional/api/test_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
native_str = str


@pytest.mark.functional
class TestGetAnnotation(object):
def test_it_returns_annotation_if_shared(self, app, annotation):
"""Unauthenticated users may view shared annotations assuming they have group access"""
Expand Down Expand Up @@ -50,7 +49,6 @@ def test_it_returns_http_404_for_private_annotation_when_unauthorized(
assert res.status_code == 404


@pytest.mark.functional
class TestGetAnnotationJSONLD(object):
def test_it_returns_annotation_if_shared(self, app, annotation):
"""Unauthenticated users may view shared annotations assuming they have group access"""
Expand Down Expand Up @@ -159,7 +157,6 @@ def test_it_returns_http_200_when_annotation_created(self, app, user_with_token)
assert res.status_code == 200


@pytest.mark.functional
class TestPatchAnnotation(object):
def test_it_updates_annotation_if_authorized(
self, app, user_annotation, user_with_token
Expand Down Expand Up @@ -211,7 +208,6 @@ def test_it_returns_http_404_if_unauthorized(
assert res.status_code == 404


@pytest.mark.functional
class TestDeleteAnnotation(object):
def test_it_deletes_annotation_if_authorized(
self, app, user_annotation, user_with_token
Expand Down
4 changes: 0 additions & 4 deletions tests/functional/api/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
native_str = str


@pytest.mark.functional
class Test400Errors(object):
"""Creating a group can raise all of the client errors we want to test"""

Expand All @@ -44,7 +43,6 @@ def test_it_400s_for_create_group_if_groupid_set_on_default_authority(
assert stripped == expected


@pytest.mark.functional
class Test404Errors(object):
# TODO: Some of these 404s should really be 403s
def test_it_404s_if_authz_fail_with_valid_accept(self, app, append_auth_client):
Expand Down Expand Up @@ -94,7 +92,6 @@ def test_it_404s_if_not_found_with_missing_accept_and_no_authz(self, app):
)


@pytest.mark.functional
class Test409Errors(object):
def test_it_409s_on_create_group_if_groupid_is_duplicate(
self, app, append_auth_client, third_party_user
Expand All @@ -113,7 +110,6 @@ def test_it_409s_on_create_group_if_groupid_is_duplicate(
)


@pytest.mark.functional
class Test415Errors(object):
def test_it_415s_if_not_found_with_bad_accept(self, app):
headers = {}
Expand Down
1 change: 0 additions & 1 deletion tests/functional/api/test_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
native_str = str


@pytest.mark.functional
class TestPutFlag(object):
def test_it_returns_http_204_if_user_allowed_to_flag_shared_annotation(
self, app, annotation, user_with_token
Expand Down
1 change: 0 additions & 1 deletion tests/functional/api/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
native_str = str


@pytest.mark.functional
class TestGetIndex(object):
def test_it_returns_links(self, app):
res = app.get("/api/")
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/api/test_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
native_str = str


@pytest.mark.functional
class TestPutHide(object):
def test_it_returns_http_204_for_group_creator(
self, app, group_annotation, user_with_token
Expand Down Expand Up @@ -67,7 +66,6 @@ def test_it_returns_http_404_if_annotation_is_private(
assert res.status_code == 404


@pytest.mark.functional
class TestDeleteHide(object):
def test_it_returns_http_204_for_group_creator(
self, app, group_annotation, user_with_token
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/api/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
native_str = str


@pytest.mark.functional
class TestGetProfile(object):
def test_it_returns_profile_with_single_group_when_not_authd(self, app):
"""
Expand Down Expand Up @@ -58,7 +57,6 @@ def test_it_returns_profile_for_third_party_authd_user(
assert group_ids == []


@pytest.mark.functional
class TestGetProfileGroups(object):
def test_it_returns_empty_list_when_not_authed(self, app):
res = app.get("/api/profile/groups")
Expand Down Expand Up @@ -88,7 +86,6 @@ def test_it_returns_group_properties(self, app, user_with_token):
assert property in res.json[0]


@pytest.mark.functional
class TestPatchProfile(object):
def test_it_allows_authenticated_user(self, app, user_with_token):
"""PATCH profile will always act on the auth'd user's profile."""
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/api/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
native_str = str


@pytest.mark.functional
class TestCreateUser(object):
def test_it_returns_http_200_when_successful(
self, app, auth_client_header, user_payload
Expand Down Expand Up @@ -86,7 +85,6 @@ def test_it_returns_409_if_user_conflict(
assert res.status_code == 409


@pytest.mark.functional
class TestUpdateUser(object):
def test_it_returns_http_200_when_successful(
self, app, auth_client_header, user, patch_user_payload
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/api/test_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from __future__ import unicode_literals

import pytest

# String type for request/response headers and metadata in WSGI.
#
# Per PEP-3333, this is intentionally `str` under both Python 2 and 3, even
Expand All @@ -16,7 +14,6 @@
native_str = str


@pytest.mark.functional
class TestIndexEndpointVersions(object):
def test_index_sets_version_response_header(self, app):
"""
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest


@pytest.mark.functional
class TestAccountSettings(object):
"""Tests for the /account/settings page."""

Expand Down
4 changes: 0 additions & 4 deletions tests/functional/test_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

from __future__ import unicode_literals

import pytest


@pytest.mark.functional
def test_atom_feed(app):
app.get("/stream.atom")


@pytest.mark.functional
def test_rss_feed(app):
app.get("/stream.rss")
4 changes: 0 additions & 4 deletions tests/functional/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


@pytest.mark.xfail # See https://github.com/hypothesis/product-backlog/issues/109
@pytest.mark.functional
def test_group_page_includes_referrer_tag(app, db_session, factories, user):
"""
The group read page should include a referrer tag.
Expand All @@ -27,7 +26,6 @@ def test_group_page_includes_referrer_tag(app, db_session, factories, user):
assert res.html.head.find("meta", attrs={"name": "referrer"}, content="origin")


@pytest.mark.functional
def test_submit_create_group_form_without_xhr_returns_full_html_page(app):
res = app.get("/groups/new")
group_form = res.forms["deform"]
Expand All @@ -38,7 +36,6 @@ def test_submit_create_group_form_without_xhr_returns_full_html_page(app):
assert res.text.startswith("<!DOCTYPE html>")


@pytest.mark.functional
def test_submit_create_group_form_with_xhr_returns_partial_html_snippet(app):
res = app.get("/groups/new")
group_form = res.forms["deform"]
Expand All @@ -49,7 +46,6 @@ def test_submit_create_group_form_with_xhr_returns_partial_html_snippet(app):
assert res.body.strip(b"\n").startswith(b"<form")


@pytest.mark.functional
def test_submit_create_group_form_with_xhr_returns_plain_text(app):
res = app.get("/groups/new")
group_form = res.forms["deform"]
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pytest


@pytest.mark.functional
class TestModeration(object):
def test_moderator_flag_listing(
self, app, group, flagged_annotation, moderator_with_token
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from h.models.auth_client import GrantType


@pytest.mark.functional
class TestOAuth(object):
def test_getting_an_access_token(self, app, authclient, userid):
"""Test using grant tokens and access tokens."""
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

from __future__ import unicode_literals

import pytest


@pytest.mark.functional
def test_search_input_text_is_submitted_as_q_without_javascript(app):
res = app.get("/search")
form = res.forms["search-bar"]
Expand Down
2 changes: 0 additions & 2 deletions tests/h/auth/tokens_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import jwt
import mock

import pytest
from hypothesis import strategies as st
from hypothesis import assume, given

Expand Down Expand Up @@ -77,7 +76,6 @@ def test_returns_none_for_malformed_header(self, pyramid_request):
assert result is None

@given(header=st.text())
@pytest.mark.fuzz
def test_returns_none_for_malformed_header_fuzz(self, header, pyramid_request):
assume(not header.startswith("Bearer "))
pyramid_request.headers["Authorization"] = header
Expand Down
2 changes: 0 additions & 2 deletions tests/h/search/parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def test_parse_with_odd_quotes_combinations(query_in, query_out):

@given(st.text())
@settings(max_examples=30)
@pytest.mark.fuzz
def test_parse_always_return_a_multidict(text):
"""Given any string input, output should always be a MultiDict."""
result = parser.parse(text)
Expand All @@ -144,7 +143,6 @@ def test_parse_always_return_a_multidict(text):

@given(kw=st.sampled_from(parser.named_fields), value=nonwhitespace_text)
@settings(max_examples=30)
@pytest.mark.fuzz
def test_parse_with_any_nonwhitespace_text(kw, value):
result = parser.parse(kw + ":" + value)
assert result.get(kw) == value
Expand Down