Mercurial > hg
comparison contrib/python-zstandard/tests/common.py @ 44147:5e84a96d865b
python-zstandard: blacken at 80 characters
I made this change upstream and it will make it into the next
release of python-zstandard. I figured I'd send it Mercurial's
way because it will allow us to drop this directory from the black
exclusion list.
# skip-blame blackening
Differential Revision: https://phab.mercurial-scm.org/D7937
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 22 Jan 2020 22:23:04 -0800 |
parents | de7838053207 |
children |
comparison
equal
deleted
inserted
replaced
44146:45ec64d93b3a | 44147:5e84a96d865b |
---|---|
48 finally: | 48 finally: |
49 os.environ.clear() | 49 os.environ.clear() |
50 os.environ.update(old_env) | 50 os.environ.update(old_env) |
51 | 51 |
52 if mod.backend != "cffi": | 52 if mod.backend != "cffi": |
53 raise Exception("got the zstandard %s backend instead of cffi" % mod.backend) | 53 raise Exception( |
54 "got the zstandard %s backend instead of cffi" % mod.backend | |
55 ) | |
54 | 56 |
55 # If CFFI version is available, dynamically construct test methods | 57 # If CFFI version is available, dynamically construct test methods |
56 # that use it. | 58 # that use it. |
57 | 59 |
58 for attr in dir(cls): | 60 for attr in dir(cls): |
82 globs, | 84 globs, |
83 name, | 85 name, |
84 fn.__func__.func_defaults, | 86 fn.__func__.func_defaults, |
85 fn.__func__.func_closure, | 87 fn.__func__.func_closure, |
86 ) | 88 ) |
87 new_method = types.UnboundMethodType(new_fn, fn.im_self, fn.im_class) | 89 new_method = types.UnboundMethodType( |
90 new_fn, fn.im_self, fn.im_class | |
91 ) | |
88 | 92 |
89 setattr(cls, name, new_method) | 93 setattr(cls, name, new_method) |
90 | 94 |
91 return cls | 95 return cls |
92 | 96 |
192 hypothesis.settings.register_profile("ci", ci_settings) | 196 hypothesis.settings.register_profile("ci", ci_settings) |
193 | 197 |
194 expensive_settings = hypothesis.settings(deadline=None, max_examples=10000) | 198 expensive_settings = hypothesis.settings(deadline=None, max_examples=10000) |
195 hypothesis.settings.register_profile("expensive", expensive_settings) | 199 hypothesis.settings.register_profile("expensive", expensive_settings) |
196 | 200 |
197 hypothesis.settings.load_profile(os.environ.get("HYPOTHESIS_PROFILE", "default")) | 201 hypothesis.settings.load_profile( |
202 os.environ.get("HYPOTHESIS_PROFILE", "default") | |
203 ) |