diff options
author | ptmcg <ptmcg@austin.rr.com> | 2022-11-06 17:24:52 -0600 |
---|---|---|
committer | ptmcg <ptmcg@austin.rr.com> | 2022-11-06 17:24:52 -0600 |
commit | c1d239103c0060212e59f99171ccc4d8405420eb (patch) | |
tree | bfe18fcc44c074991f47245c5241d1c4b73d24be /pyparsing | |
parent | 764dbdc1970e522f5ffe3bd03a0ddb5d1cfcb798 (diff) | |
download | pyparsing-git-c1d239103c0060212e59f99171ccc4d8405420eb.tar.gz |
Fix stacklevel when warning invalid config setting; added assertWarns wrapper similar to assertRaises wrapper, to echo success/fail status
Diffstat (limited to 'pyparsing')
-rw-r--r-- | pyparsing/util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pyparsing/util.py b/pyparsing/util.py index b3db48a..2a06e39 100644 --- a/pyparsing/util.py +++ b/pyparsing/util.py @@ -23,7 +23,8 @@ class __config_flags: if dname in cls._fixed_names: warnings.warn( f"{cls.__name__}.{dname} {cls._type_desc} is {str(getattr(cls, dname)).upper()}" - f" and cannot be overridden" + f" and cannot be overridden", + stacklevel=3, ) return if dname in cls._all_names: |