Skip to content

Commit

Permalink
Merge pull request #180 from graingert/build-wheel-only-once
Browse files Browse the repository at this point in the history
build wheel only once per tox invocation
  • Loading branch information
graingert authored Sep 24, 2020
2 parents fb045e9 + ddf283a commit d5ad70e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/source/NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Changes
- the ldaptor whl is tested with tox. The sdist is now untested,
deprecated and should only be used for compatability with very old
packaging tools.
- the setup.py file is deprecated and will be removed in a future release.

Bugfixes
^^^^^^^^
Expand Down
16 changes: 10 additions & 6 deletions ldaptor/test/test_ldiftree.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def reverse_listdir():

self.addCleanup(reverse_listdir)

def chmod(self, path, mode):
self.addCleanup(os.chmod, path, os.stat(path).st_mode)
os.chmod(path, mode)


class Dir2LDIF(RandomizeListdirTestCase):
def setUp(self):
Expand Down Expand Up @@ -115,7 +119,7 @@ def testSimpleRead(self):

@skipIfWindowsOrRoot
def testNoAccess(self):
os.chmod(os.path.join(self.tree,
self.chmod(os.path.join(self.tree,
'dc=com.dir',
'dc=example.dir',
'cn=foo.ldif'),
Expand Down Expand Up @@ -445,29 +449,29 @@ def _cb_test_children_twoChildren_callback(self, r, children):

@skipIfWindowsOrRoot
def test_children_noAccess_dir_noRead(self):
os.chmod(self.meta.path, 0o300)
self.chmod(self.meta.path, 0o300)
d = self.meta.children()
def eb(fail):
fail.trap(OSError)
self.assertEqual(fail.value.errno, errno.EACCES)
os.chmod(self.meta.path, 0o755)
self.chmod(self.meta.path, 0o755)
d.addCallbacks(testutil.mustRaise, eb)
return d

@skipIfWindowsOrRoot
def test_children_noAccess_dir_noExec(self):
os.chmod(self.meta.path, 0o600)
self.chmod(self.meta.path, 0o600)
d = self.meta.children()
def eb(fail):
fail.trap(IOError)
self.assertEqual(fail.value.errno, errno.EACCES)
os.chmod(self.meta.path, 0o755)
self.chmod(self.meta.path, 0o755)
d.addCallbacks(testutil.mustRaise, eb)
return d

@skipIfWindowsOrRoot
def test_children_noAccess_file(self):
os.chmod(os.path.join(self.meta.path, u'cn=foo.ldif'), 0)
self.chmod(os.path.join(self.meta.path, u'cn=foo.ldif'), 0)
d = self.meta.children()
def eb(fail):
fail.trap(IOError)
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ envlist =
[testenv]
wheel = True
wheel_pep571 = True
wheel_pep517 = True
wheel_build_env = build
deps =
coverage >= 5.3
pyparsing
Expand Down Expand Up @@ -67,6 +68,9 @@ commands =
{dev,linters}: pyflakes ldaptor
{dev,linters}: check-manifest
[testenv:build]
# empty environment to build universal wheel once per tox invocation
# https://github.com/ionelmc/tox-wheel#build-configuration
[testenv:documentation]
deps = sphinx
Expand Down

0 comments on commit d5ad70e

Please sign in to comment.