Skip to content

Instantly share code, notes, and snippets.

@cocodrips
Created August 18, 2017 07:01
Show Gist options
  • Save cocodrips/d4528f4feb6dd78c6d6ebc0829d6b4ef to your computer and use it in GitHub Desktop.
Save cocodrips/d4528f4feb6dd78c6d6ebc0829d6b4ef to your computer and use it in GitHub Desktop.
pytestのparametrizeで遊ぶ
"""
日付や年月に関する処理
"""
import pytest
@pytest.mark.parametrize('nengo,year,seireki', [
('平成', 29, 2017),
('昭和', 63, 1988)
])
def test_nengo_to_seireki(nengo, year, seireki):
target = util.date.nengo_to_seireki(nengo, year)
assert target == seireki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment