import re
from datetime import date

import requests
import pytest

from czech_holidays import holidays, Holidays, Holiday


WIKIPEDIA_RE = re.compile(r'Rok\s\d{4}</th>\s<td>(?P<date>\w+)')

WIKIPEDIA_DATE_RE = re.compile(r'(?P<day>\d+)\.\s+(?P<month>\w+)\s+(?P<year>\d{4})')


def fetch_easter_dates():
    response = requests.get('https://cs.wikipedia.org/wiki/Velikono%C4%8Dn%C3%AD_pond%C4%9Bl%C3%AD')
    response.raise_for_status()
    return [parse_wikipedia_date(match.group('date'))
            for match in WIKIPEDIA_RE.finditer(response.text)]


def parse_wikipedia_date(date_text):
    match = WIKIPEDIA_DATE_RE.search(date_text)
    groups = match.groupdict()
    return date(int(groups['year']),
                3 if 'bře' in groups['month'] else 4,
                int(groups['day']))


@pytest.mark.parametrize('date_text, expected', [
    ('5. dubna 2021', date(2021, 4, 5)),
    ('18. dubna 2022', date(2022, 4, 18)),
    ('10. dubna 2023', date(2023, 4, 10)),
    ('31. března 2024', date(2024, 3, 31)),
])
def test_parse_wikipedia_date(date_text, expected):
    assert parse_wikipedia_date(date_text) == expected


@pytest.mark.parametrize('easter_date', fetch_easter_dates())
def test_easter(easter_date):
    holiday = Holidays(easter_date.year).easter
    assert (holiday.year, holiday.month, holiday.day) == (easter_date.year, easter_date.month, easter_date.day)


def test_christmas():
    holiday = Holidays(2022).christmas
    assert (holiday.year, holiday.month, holiday.day) == (2022, 12, 24)

@@ -34,24 +34,8 @@
 te%0A%0A
-import requests%0A
 impo
@@ -44,16 +44,16 @@
  pytest%0A
+
 %0Afrom cz
@@ -106,755 +106,53 @@
 y%0A%0A%0A
-WIKIPEDIA_RE = re.compile(r'Rok%5Cs%5Cd%7B4%7D%3C/th%3E%5Cs%3Ctd%3E(?P%3Cdate%3E%5Cw+)')%0A%0AWIKIPEDIA_DATE_RE = re.compile(r'(?P%3Cday%3E%5Cd+)%5C.%5Cs+(?P%3Cmonth%3E%5Cw+)%5Cs+(?P%3Cyear%3E%5Cd%7B4%7D)')%0A%0A%0Adef fetch_easter_dates():%0A    response = requests.get('https://cs.wikipedia.org/wiki/Velikono%25C4%258Dn%25C3%25AD_pond%25C4%259Bl%25C3%25AD')%0A    response.raise_for_status()%0A    return %5Bparse_wikipedia_date(match.group('date'))%0A            for match in WIKIPEDIA_RE.finditer(response.text)%5D%0A%0A%0Adef parse_wikipedia_date(date_text):%0A    match = WIKIPEDIA_DATE_RE.search(date_text)%0A    groups = match.groupdict()%0A    return date(int(groups%5B'year'%5D),%0A                3 if 'b%C5%99e' in groups%5B'month'%5D else 4,%0A                int(groups%5B'day'%5D))%0A%0A%0A@pytest.mark.parametrize('date_text, expected', %5B%0A    ('5. dubna 2021',
+@pytest.mark.parametrize('easter_date', %5B%0A   
  dat
@@ -168,33 +168,13 @@
 , 5)
-)
 ,%0A   
- ('18. dubna 2022',
  dat
@@ -191,33 +191,13 @@
  18)
-)
 ,%0A   
- ('10. dubna 2023',
  dat
@@ -214,34 +214,13 @@
  10)
-)
 ,%0A   
- ('31. b%C5%99ezna 2024',
  dat
@@ -237,185 +237,13 @@
  31)
-)
 ,%0A%5D)%0A
-def test_parse_wikipedia_date(date_text, expected):%0A    assert parse_wikipedia_date(date_text) == expected%0A%0A%0A@pytest.mark.parametrize('easter_date', fetch_easter_dates())%0A
 def 

simplify tests