Skip to content

Commit

Permalink
Delete test for pydoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémy Phetphoumy committed Dec 1, 2023
1 parent 0ed195a commit 368c0a5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
23 changes: 0 additions & 23 deletions tests/test_main.py
Expand Up @@ -2,7 +2,6 @@
import platform
import re
import sys
import warnings
from collections import defaultdict
from copy import deepcopy
from dataclasses import dataclass
Expand Down Expand Up @@ -2977,28 +2976,6 @@ class Bar(BaseModel):
assert Foo.__pydantic_core_schema__


def test_help(create_module):
# since pydoc/help access all attributes to generate their documentation,
# this triggers the deprecation warnings.
with warnings.catch_warnings():
module = create_module(
# language=Python
"""
import pydoc
from pydantic import BaseModel
class Model(BaseModel):
x: int
help_result_string = pydoc.render_doc(Model)
"""
)
warnings.simplefilter('error')
assert 'class Model' in module.help_result_string


def test_cannot_use_leading_underscore_field_names():
with pytest.raises(
NameError, match="Fields must not use names with leading underscores; e.g., use 'x' instead of '_x'"
Expand Down
20 changes: 0 additions & 20 deletions tests/test_root_model.py
@@ -1,5 +1,4 @@
import pickle
import warnings
from datetime import date, datetime
from typing import Any, Dict, List, Optional, Union

Expand Down Expand Up @@ -591,25 +590,6 @@ class Model(RootModel):
Model.model_json_schema()


def test_help(create_module):
# since pydoc/help access all attributes to generate their documentation,
# this triggers the deprecation warnings.
with warnings.catch_warnings():
module = create_module(
# language=Python
"""
import pydoc
from pydantic import RootModel
help_result_string = pydoc.render_doc(RootModel)
"""
)
warnings.simplefilter('error')
assert 'class RootModel' in module.help_result_string


def test_copy_preserves_equality():
model = RootModel()

Expand Down

0 comments on commit 368c0a5

Please sign in to comment.