Skip to content

Commit 6c1398b

Browse files
committed
Remove junk; remove unnecessary variable
1 parent 5fdb773 commit 6c1398b

3 files changed

Lines changed: 5 additions & 34 deletions

File tree

docs/conf.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,13 @@
1-
#
2-
# marshmallow documentation build configuration file.
3-
#
4-
# This file is execfile()d with the current directory set to its containing dir.
5-
#
6-
# Note that not all possible configuration values are present in this
7-
# autogenerated file.
8-
#
9-
# All configuration values have a default; values that are commented out
10-
# serve to show the default.
11-
121
from collections import OrderedDict
132
import sys
143
import os
154
import datetime as dt
165

176
import alabaster
187

19-
# If extensions (or modules to document with autodoc) are in another directory,
20-
# add these directories to sys.path here. If the directory is relative to the
21-
# documentation root, use os.path.abspath to make it absolute, like shown here.
228
sys.path.insert(0, os.path.abspath(os.path.join("..", "src")))
239
import marshmallow # noqa: E402
2410

25-
# -- General configuration -----------------------------------------------------
26-
27-
# If your documentation needs a minimal Sphinx version, state it here.
28-
# needs_sphinx = '1.0'
29-
30-
# Add any Sphinx extension module names here, as strings. They can be extensions
31-
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3211
extensions = [
3312
"sphinx.ext.autodoc",
3413
"sphinx.ext.intersphinx",
@@ -45,15 +24,11 @@
4524

4625
issues_github_path = "marshmallow-code/marshmallow"
4726

48-
# Add any paths that contain templates here, relative to this directory.
4927
templates_path = ["_templates"]
5028

51-
# The suffix of source filenames.
5229
source_suffix = ".rst"
53-
# The master toctree document.
5430
master_doc = "index"
5531

56-
# General information about the project.
5732
project = "marshmallow"
5833
copyright = ' {:%Y} <a href="https://stevenloria.com">Steven Loria</a> and contributors'.format(
5934
dt.datetime.utcfromtimestamp(os.path.getmtime("../CHANGELOG.rst"))

src/marshmallow/fields.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858
"Pluck",
5959
]
6060

61-
MISSING_ERROR_MESSAGE = (
62-
"ValidationError raised by `{class_name}`, but error key `{key}` does "
63-
"not exist in the `error_messages` dictionary."
64-
)
65-
6661

6762
class Field(FieldABC):
6863
"""Basic field from which other fields should extend. It applies no
@@ -256,8 +251,11 @@ def make_error(self, key: str, **kwargs) -> ValidationError:
256251
msg = self.error_messages[key]
257252
except KeyError as error:
258253
class_name = self.__class__.__name__
259-
msg = MISSING_ERROR_MESSAGE.format(class_name=class_name, key=key)
260-
raise AssertionError(msg) from error
254+
message = (
255+
"ValidationError raised by `{class_name}`, but error key `{key}` does "
256+
"not exist in the `error_messages` dictionary."
257+
).format(class_name=class_name, key=key)
258+
raise AssertionError(message) from error
261259
if isinstance(msg, (str, bytes)):
262260
msg = msg.format(**kwargs)
263261
return ValidationError(msg)

tests/test_schema.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
31
import datetime as dt
42
import decimal
53
import random

0 commit comments

Comments
 (0)