feat(tests): Phase 0 - Fix flaky and broken tests
Implements Phase 0 of v1.5.0 per ADR-012 and RELEASE.md. Changes: - Remove 5 broken multiprocessing tests (TestConcurrentExecution, TestPerformance) - Fix brittle XML assertion tests (check semantics not quote style) - Fix test_debug_level_for_early_retries logger configuration - Rename test_feed_route_streaming to test_feed_route_caching (correct name) Results: - Test count: 879 → 874 (5 removed as planned) - All tests pass consistently (verified across 3 runs) - No flakiness detected References: - ADR-012: Flaky Test Removal and Test Quality Standards - docs/projectplan/v1.5.0/RELEASE.md Phase 0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -80,15 +80,17 @@ class TestExplicitEndpoints:
|
||||
response = client.get('/feed.atom')
|
||||
assert response.status_code == 200
|
||||
assert response.headers['Content-Type'] == 'application/atom+xml; charset=utf-8'
|
||||
# Check for XML declaration (encoding may be utf-8 or UTF-8)
|
||||
assert b'<?xml version="1.0"' in response.data
|
||||
# Check for XML declaration (don't assert quote style)
|
||||
assert b'<?xml version=' in response.data
|
||||
assert b'encoding=' in response.data
|
||||
assert b'<feed xmlns="http://www.w3.org/2005/Atom"' in response.data
|
||||
|
||||
def test_feed_json_endpoint(self, client):
|
||||
"""GET /feed.json returns JSON Feed"""
|
||||
response = client.get('/feed.json')
|
||||
assert response.status_code == 200
|
||||
assert response.headers['Content-Type'] == 'application/feed+json; charset=utf-8'
|
||||
# Check Content-Type starts with expected type (don't require charset)
|
||||
assert response.headers['Content-Type'].startswith('application/feed+json')
|
||||
# JSON Feed is streamed, so we need to collect all chunks
|
||||
data = b''.join(response.response)
|
||||
assert b'"version": "https://jsonfeed.org/version/1.1"' in data
|
||||
@@ -129,7 +131,7 @@ class TestContentNegotiation:
|
||||
"""Accept: application/feed+json returns JSON Feed"""
|
||||
response = client.get('/feed', headers={'Accept': 'application/feed+json'})
|
||||
assert response.status_code == 200
|
||||
assert response.headers['Content-Type'] == 'application/feed+json; charset=utf-8'
|
||||
assert response.headers['Content-Type'].startswith('application/feed+json')
|
||||
data = b''.join(response.response)
|
||||
assert b'"version": "https://jsonfeed.org/version/1.1"' in data
|
||||
|
||||
@@ -137,7 +139,7 @@ class TestContentNegotiation:
|
||||
"""Accept: application/json returns JSON Feed"""
|
||||
response = client.get('/feed', headers={'Accept': 'application/json'})
|
||||
assert response.status_code == 200
|
||||
assert response.headers['Content-Type'] == 'application/feed+json; charset=utf-8'
|
||||
assert response.headers['Content-Type'].startswith('application/feed+json')
|
||||
data = b''.join(response.response)
|
||||
assert b'"version": "https://jsonfeed.org/version/1.1"' in data
|
||||
|
||||
@@ -171,7 +173,7 @@ class TestContentNegotiation:
|
||||
'Accept': 'application/json;q=1.0, application/atom+xml;q=0.8'
|
||||
})
|
||||
assert response.status_code == 200
|
||||
assert response.headers['Content-Type'] == 'application/feed+json; charset=utf-8'
|
||||
assert response.headers['Content-Type'].startswith('application/feed+json')
|
||||
|
||||
def test_browser_accept_header(self, client):
|
||||
"""Browser-like Accept header returns RSS"""
|
||||
|
||||
Reference in New Issue
Block a user