Skip to content

Commit

Permalink
ci: Use setup/teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Feb 18, 2024
1 parent 3962bb4 commit 700779e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_it.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,21 @@ def test_with_version(self):


class TestForParse:
def test_simple_name_only(self):
from docutils import nodes

def setup_method(self):
core.bootstrap()

def teardown_method(self):
from docutils.parsers.rst import roles

del roles._role_registry["pypi"]

def test_simple_name_only(self):
doctree: nodes.document = publish_doctree(":pypi:`docutils`")
refs = list(doctree.findall(nodes.reference))
assert len(refs) == 1
assert refs[0]["refuri"] == "https://pypi.org/project/docutils/"

def test_simple_with_version(self):
core.bootstrap()

doctree: nodes.document = publish_doctree(":pypi:`docutils==0.3`")
refs = list(doctree.findall(nodes.reference))
assert len(refs) == 1
Expand Down

0 comments on commit 700779e

Please sign in to comment.