[Checkins] [zopefoundation/zope.security] 8b01ec: Simplify _compat.py now that we only run on newer ...

GitHub noreply at github.com
Fri Sep 8 14:14:18 CEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.security
  Commit: 8b01ecd553837b834d2e553e1198d841be380a9c
      https://github.com/zopefoundation/zope.security/commit/8b01ecd553837b834d2e553e1198d841be380a9c
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M src/zope/security/_compat.py
    M src/zope/security/_definitions.py
    M src/zope/security/checker.py
    M src/zope/security/metadirectives.py
    M src/zope/security/permission.py
    M src/zope/security/tests/test_checker.py
    M src/zope/security/tests/test_management.py
    M src/zope/security/tests/test_metaconfigure.py
    M src/zope/security/tests/test_proxy.py
    M src/zope/security/tests/test_zcml_functest.py
    M src/zope/security/zcml.py

  Log Message:
  -----------
  Simplify _compat.py now that we only run on newer Pythons

- We have u'literals' so we don't need a _u() function.
  For the record the Emacs replacement regex was
  `_u(\(['"]\)\([^)]*\)\1) -> u\1\2\1`. Amazingly, I typed that right
  on the first try.

A few things were only used in one (test) file or function, so it was
better to keep the use, if any, local and out of the "public" api:

- We can use io.StringIO everywhere and it's fast. It was only
 imported in one file anyway.
- We can just import pickle. It was only imported in one file anyway.
- TEXT was only used in one test function, `type(u'')` is just as
 clear (especially since the usual name is `text_type`).
- reload was only used in one test function, so move the definition
 there.


  Commit: a0372d5949642bd744c3d97628f136c51e743e38
      https://github.com/zopefoundation/zope.security/commit/a0372d5949642bd744c3d97628f136c51e743e38
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M CHANGES.rst
    M src/zope/security/_compat.py
    M src/zope/security/tests/test_proxy.py

  Log Message:
  -----------
  Use importlib.reload instead of imp.reload.

Some minor cleanups and simplifications to test_proxy.py:

- use loadTestsFromName() and wrap the conditional test in
  @unittest.skipIf. This gets environments closer to running the same
  number of tests, which helps when comparing to make sure nothing
  gets skipped.
- Break compound assertions in test_coerce out into separate
  assertions for ease of reading and debuging.


  Commit: d8565d6dc4758b42425be5adf2d4786d0c8d10a6
      https://github.com/zopefoundation/zope.security/commit/d8565d6dc4758b42425be5adf2d4786d0c8d10a6
  Author: Jason Madden <jason+github at nextthought.com>
  Date:   2017-09-08 (Fri, 08 Sep 2017)

  Changed paths:
    M CHANGES.rst
    M src/zope/security/_compat.py
    M src/zope/security/_definitions.py
    M src/zope/security/checker.py
    M src/zope/security/metadirectives.py
    M src/zope/security/permission.py
    M src/zope/security/tests/test_checker.py
    M src/zope/security/tests/test_management.py
    M src/zope/security/tests/test_metaconfigure.py
    M src/zope/security/tests/test_proxy.py
    M src/zope/security/tests/test_zcml_functest.py
    M src/zope/security/zcml.py

  Log Message:
  -----------
  Merge pull request #32 from zopefoundation/remove_u

Simplify _compat.py now that we only run on newer Pythons


Compare: https://github.com/zopefoundation/zope.security/compare/ed4d2b755b0a...d8565d6dc475


More information about the checkins mailing list